如何在 emacs 中指定后备字体?
我刚刚从源代码安装了 Emacs 24,当主要字体不包含我需要的国际字形时,我想安装主要字体和后备字体。在Linux下,大多数环境都是通过fontconfig完成的,但是尝试设置字体
(set-default-font "Monospace 11")
不起作用,而不是fontconfig Monospace集合,似乎我得到了“Sans”。
要获得等宽字体,我需要执行以下操作:
(set-default-font "Dejavu Sans Mono 11")
但不幸的是它不包含我想要的字形。所以我的问题是 emacs 是否提供了一种“后备”机制,只要主要字体不可用,它就会使用该机制
I have just installed Emacs 24 from source and would like to install a primary font as well as a fallback font, when the primary font does not include the international glyphs that I need. Under Linux this is done by most environments through fontconfig, but trying to set the font by
(set-default-font "Monospace 11")
doesn't work, instead of the fontconfig Monospace collection, it appears that I get "Sans".
To get a monospace font I need to do something like:
(set-default-font "Dejavu Sans Mono 11")
but unfortunately it does not contain the glyphs that I want. So my question is if emacs provides a "fallback" mechanism that it uses whenever the primary font does not cona
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Gilles 向我指出了使用字体集的解决方案。我了解到字体集足够灵活,因此您可以针对不同的 unicode 范围使用不同的字体。因此,要使用适用于希伯来语的 Miriam Mono CLM,您可以输入以下配置选项:
Gilles pointed me to the solution which is to use fontsets. I learned that fontsets are flexible enough so that you can use different fonts for different unicode ranges. Thus to use Miriam Mono CLM for Hebrew, you can enter the following configuration option:
尝试
或
这将为所有缺少定义的字形使用指定的字体(和大小)。您需要安装字体,可以在网上找到。
或者,从 MELPA 安装 unicode-fonts 包。
Try
or
This will use the named font (and size) for all glyphs with missing definitions. You need to install the font, which can be found on the net.
Alternatively, install the unicode-fonts package from MELPA.