Emacs org-mode Chinese and English font settings table of Contents
- 1. Problems with default fonts
- 2. Workaround
- 2.1. Environmental statement
- 2.2. Ideas and methods
- 2.3. Emacs Setup Code
- 2.4. Display effect
1Problems with default fonts
has been looking for a way to take note of the software, recently found Org-mode, after the trial feel really very useful.
However, the Org-mode default font has a problem when drawing tables: Because the Chinese and English fonts are different in width, the table cannot be aligned. As shown in the following:
2Workaround2.1Environment description
The native environment for Mac OS X, Emacs24.4, is tested by the following methods.
2.2Ideas and methods
Few fonts are equal in English and Chinese, even if some software is implemented, the visualization is not good. However, Emacs can set different fonts in English and Chinese, as long as they find two equal-width fonts, and find their proportional relationship is OK.
After a period of comparison, the selection of Monaco and Wenquanyi Zen Hei, such as wide-micron black. Monaco font System comes with, Wenquanyi Zen Hei and other wide-micron black font can be downloaded to the Internet.
After testing on my machine, the Monaco 14 and Wenquanyi Zen Hei, such as the wide-micron Black 16 show the ratio is just 1:2, that is, a Chinese accounted for two English position.
2.3Emacs Setup Code
;;; Chinese and English font settings;; Setting 中文版 Font (set-face-attribute ' default Nil:font "Monaco 14");; Chinese font (dolist (CharSet ' (Kana han symbol cjk-misc bopomofo)) (Set-fontset-font (frame-parameter nil ' Font) CharSet ( Font-spec:family "Wenquanyi Micro Hei Mono": size 16)))
2.4Show effect
After setting the table in Orgmode, the following results are displayed:
Author:galaxy
Created:2015-04-21 Tue 22:43
Emacs 24.4.1 (ORG mode 8.2.10)
Validate
Emacs org-mode in English font settings