Emacs 23 Xft 字体设置

LiYanrui posted @ Jun 08, 2008 06:16:18 PM in GNU/Linux & Unix with tags emacs 23 , 6360 阅读

前几天重又装回了 Emacs 23。阔别经年,现在都不大会用了,中文字体设置的问题就让我有点犯难。方才谷歌了一番,按照 Ubuntu 中文论坛的 zhan 给出的一种方法,我加以调整,总算搞定。现在 Emacs 显示的中/英文档看起来比较顺眼了。

Step 1: 使用 fc-list 命令,查找自己喜欢的英文/中文字体,记下它们的名字;

Step 2: 在 ~/.Xresources 文档中作如下设置:

Xft.antialias: 0
Xft.hinting: 1
Xft.hintstyle: hintfull
Emacs.FontBackend: xft

注意,Xft.antialias 的值若为 1,表示打开字体的抗锯齿效果;反之,则表示关闭字体抗锯齿效果。如果字号较小,关闭字体抗锯齿效果会让字体的外观更为清晰一些。

Step 3: 在 ~/.emacs 文档添加以下代码:

(set-default-font "Courier New-12")
(set-fontset-font (frame-parameter nil 'font)
              'unicode  '("AR PL UMing CN" . "unicode-bmp"))

我使用 12 pt 的 Courier New 作为默认字体,当该字体缺少对应字符时,则使用 AR PL UMing CN 字体。这样,在 Emacs 中显示英文时,使用的是 Courier New;显示中文时,则使用 AR PL UMing CN 作为中文字体。

效果:

  • 无匹配

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter