Emacs org-mode Chinese and English font settings

Source: Internet
Author: User


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.