Skip to content

Instantly share code, notes, and snippets.

@billyct
Forked from ricardolee/emacs-font.lisp
Created April 25, 2017 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billyct/848563245cf9ef54910df5451408c225 to your computer and use it in GitHub Desktop.
Save billyct/848563245cf9ef54910df5451408c225 to your computer and use it in GitHub Desktop.
emacs font config
(setq fonts
(cond ((eq system-type 'darwin) '("Monaco" "STHeiti"))
((eq system-type 'gnu/linux) '("Menlo" "WenQuanYi Zen Hei"))
((eq system-type 'windows-nt) '("Consolas" "Microsoft Yahei"))))
(set-face-attribute 'default nil :font
(format "%s:pixelsize=%d" (car fonts) 14))
(dolist (charset '(kana han symbol cjk-misc bopomofo))
(set-fontset-font (frame-parameter nil 'font) charset
(font-spec :family (car (cdr fonts)))))
;; Fix chinese font width and rescale
(setq face-font-rescale-alist '(("Microsoft Yahei" . 1.2) ("WenQuanYi Micro Hei Mono" . 1.2) ("STHeiti". 1.2)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment