ubuntu字体安装设置心得


vim /etc/X11/xorg.conf
  FontPath "/usr/share/fonts/yahei"

  apt-get install msttcorefonts

  字体将会被安装到 /usr/share/fonts/truetype/msttcorefonts

  分别是:
  Andale Mono, Arial, Comic Sans MS, Courier New, Georgia
  Impact, Times New Roman, Trebuchet MS, Verdana, Webdings

  刚装的 MS core font 的路径需要加么?

  答案是一般不用了,因为在 Debian/Ubuntu 中有 defoma 帮我们管理字体,而 defoma 会自动在 /etc/X11/xorg.conf 中添加自己的字体路径:

  # path to defoma fonts

  FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"

  而且 defoma 会自动调用 mkfontdir,mkfontscale 来创建 fonts.dir,fonts.scale,这些是 legacy X font server 需要的,注意不是 fontconfig 的需要。但是你使用老式程序的话,你会用到 xfs。

  这里要注意区分 fontconfig 和 xfs,它们在你的系统中是共存的,可以简单用新旧两代字体系统来区分。

相关内容