【问题标题】:Cannot use linux fonts in emacs under Bash for Windows无法在 Bash for Windows 下的 emacs 中使用 linux 字体
【发布时间】:2017-11-06 23:24:16
【问题描述】:

我正在运行 bashforwindows,并且按照 Luke Lee 给出的从源代码安装的精彩说明,在本机安装 emacs(不是 Windows 的 emacs):How to use X Windows with Emacs on Windows 10 Bash?

我可以使用 MobaXTerm 作为 xserver 从 bash 运行 emacs。但是,我无法让 emacs 看到我的任何 linux 字体(或 windows 字体,就此而言)。

在我的 shell 中,我可以运行 fc-list 并获得一个列表,其中包括 consola 和 Inconsolata(这是我想要的)之类的内容:

[~]$ fc-list
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/home/hal/.local/share/fonts/consolaz.ttf: Consolas:style=Bold Italic
/home/hal/.local/share/fonts/Inconsolata-Bold.ttf: Inconsolata:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/home/hal/.local/share/fonts/consolai.ttf: Consolas:style=Italic
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/home/hal/.local/share/fonts/Inconsolata-Regular.ttf: Inconsolata:style=Regular
/home/hal/.local/share/fonts/consolab.ttf: Consolas:style=Bold
/home/hal/.local/share/fonts/consola.ttf: Consolas:style=Regular
/usr/share/fonts/truetype/inconsolata/Inconsolata.otf: Inconsolata:style=Medium
/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf: DejaVu Serif:style=Book

但是,emacs 看不到这些。如果我从那个 shell 运行 emacs,然后从 emacs 运行 (print (font-family-list)),我得到:

("courier" "helvetica" "new century schoolbook" "times" "utopia"
"lucida" "lucidabright" "lucidatypewriter" "fixed" "nil" "clearlyu
alternate glyphs" "clearlyu arabic extra" "clearlyu arabic" "clearlyu
devanagari" "clearlyu devangari extra" "clearlyu ligature" "clearlyu
pua" "clean" "fixed" "open look cursor" "open look glyph" "courier"
"helvetica" "new century schoolbook" "times" "utopia" "lucida"
"lucidabright" "lucidatypewriter" "fixed" "nil" "clearlyu alternate
glyphs" "clearlyu arabic extra" "clearlyu arabic" "clearlyu
devanagari" "clearlyu devangari extra" "clearlyu ligature" "clearlyu
pua" "clean" "fixed" "open look cursor" "open look glyph" "fixed")

其中不包含我想要的任何字体。

如何让 emacs 查看可用的字体,或者找到其他安装方式?

【问题讨论】:

    标签: emacs windows-subsystem-for-linux


    【解决方案1】:

    获取一个使用 fontconfig 支持编译的 emacs 版本,而不是只使用(丑陋的,不推荐使用的受限的)X 核心字体子系统的版本

    【讨论】:

    • 谢谢!我尝试使用 fontconfig 支持从头开始重建,但似乎没有帮助。我首先安装了 fontconfig 和 libxft,然后 emacs configure 找到了它们:检查 fontconfig >= 2.2.0... 是 CFLAGS='-I/usr/include/freetype2' LIBS='-lfontconfig -lfreetype' 检查 xft > = 0.13.0... 是 CFLAGS='-I/usr/include/freetype2' LIBS='-lXft' 我重建了 emacs 并运行了,但是当我这样做时得到相同的字体列表(打印(font-family-list ))。
    猜你喜欢
    • 1970-01-01
    • 2020-02-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-17
    • 2013-04-24
    • 2016-12-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多