Emacs Init: Font for Chinese

By Xah Lee. Date: . Last updated: .

Set Font for Chinese

put this in your Emacs Init File:

;; Emacs: Setup Font for Chinese
;; http://xahlee.info/emacs/emacs/emacs_set_font_zh.html
(set-fontset-font
 t
 'han
 (cond
  ((member "Microsoft YaHei" (font-family-list)) "Microsoft YaHei")
  ((member "Microsoft JhengHei" (font-family-list)) "Microsoft JhengHei")
  ;; ((member "SimHei" (font-family-list)) "SimHei")
  ((member "PingFang SC" (font-family-list)) "PingFang SC")
  ;; ((member "Heiti SC" (font-family-list)) "Heiti SC")
  ;; ((member "Heiti TC" (font-family-list)) "Heiti TC")
  ((member "WenQuanYi Micro Hei" (font-family-list)) "WenQuanYi Micro Hei")))

Note: 2020-05-28, in emacs 26 or before, on Microsoft Windows 10, if you don't set font for Chinese, and if a buffer has Chinese character, then emacs operation such as moving cursor will be super slow, like 1/3 of a second when you press arrow key.

Emacs and Unicode

File Encoding

Unicode Font Setup

Emacs, font setup