emacs 在 gentoo 中看不到我的字体

val*_*lya 11 ubuntu gentoo emacs fonts

我从 ubuntu linux 复制了我的 ~/.emacs 文件;我已经安装了 Consolas 字体(它可以在 gnome 终端中使用,并且是默认的 Monospace 字体);但 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))
Run Code Online (Sandbox Code Playgroud)

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

我能做什么?

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

cjm*_*cjm 9

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