Emacs

Emacs设置中文字体-20151005-1141

2015-10-05  本文已影响1457人  qujian

Mac OS X 刚刚更新了 EI Capitan,添加了新的中文字体“苹方”,想给Emacs也换上新字体,时间久了也不记得怎么更换字体的,特留此为记录。

1. 查看系统字体

在Options->Set Default Font中选择“苹方-简”,

2.执行命令

M-x describe-font
结果显示:

name (opened by): -*-PingFang SC-normal-normal-normal-*-14-*-*-*-p-0-iso10646-1
       full name: PingFang SC:pixelsize=14:weight=normal:slant=normal:width=normal:spacing=0:scalable=true
            size: 14
          height: 20
 baseline-offset:  0
relative-compose:  0

这样便得到了字体的名称:“PingFang SC”

;; -----------------------------------------------------------------------------
;; setting font for mac system
;; -----------------------------------------------------------------------------
;; Setting English 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 "PingFang SC" :size 14)))

;; Note: you can chang "PingFang SC" to "Microsoft YaHei" or other fonts
上一篇下一篇

猜你喜欢

热点阅读