Created
September 14, 2016 02:17
-
-
Save sylecn/fee6caf59bc6d2e84eaddb257a9f8cff to your computer and use it in GitHub Desktop.
Emacs font config for Chinese users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'cl) | |
(defun my-set-fontset (fontset alst) | |
"set fontset according to alst. | |
The alst contains TARGET FONT-SPEC pairs. TARGET should be from | |
most specific (latin) to most generic (nil). Otherwise, some | |
lines will have no effect. | |
see `set-fontset-font' for what could be used for TARGET and FONT-SPEC" | |
(loop for (target font-spec) in (reverse alst) | |
do (set-fontset-font fontset target font-spec))) | |
(my-set-fontset | |
"fontset-startup" | |
'((latin "Bitstream Vera Sans Mono-14") | |
(han "Noto Sans CJK SC-14") | |
(cjk-misc "Noto Sans CJK SC-14") | |
(nil "文泉驿等宽正黑-14"))) | |
;; set fontset-startup as current frame's font. | |
(set-frame-font "fontset-startup" nil t) | |
;; set fontset-startup as default frame font. | |
(add-to-list 'default-frame-alist '(font . "fontset-startup")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment