emacs 在 gentoo 中看不到我的字体

emacs 在 gentoo 中看不到我的字体

我从 ubuntu linux 复制了 ~/.emacs 文件;我已经安装了 Consolas 字体(它可以在 gnome 终端中工作,并且作为默认的等宽字体);但Emacs看不到它

(custom-set-faces '(default ((t (:inherit nil :stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "microsoft" :family "Consolas"))) t))

这就是我在 emacs 中设置字体的方法,但它不起作用(它在 Ubuntu 中有效并且仍然有效)

我能做些什么?

字体选择菜单(我猜是menu-set-font)看起来很奇怪,由三个选项组成:Misc、Courier 和 Fontset,而且没有我的系统字体的迹象

答案1

正如 Gilles 所说,要在 Emacs 23 中使用像 Consolas 这样的 TrueType 字体,您必须将其与 Freetype 和 Fontconfig 库链接。在 Gentoo 中,你可以通过打开xft 使用标志在构建 Emacs 时。您需要打开该标志(全局或仅针对应用程序编辑器/emacs)并重新安装 Emacs。

答案2

对 TrueType 字体(例如 Consolas 字体)的支持(更一般地说,对客户端渲染字体的支持)需要针对 Freetype 和 Fontconfig 库编译 Emacs。这是在 Emacs 23 中引入的。之前,仅支持传统的服务器渲染字体。看Emacs 手册有关这两种字体以及如何使用它们的更多信息。

相关内容