emacs - 粗体属性不起作用

标签 emacs fonts elisp

我正在尝试使 Emacs 中的字体更大胆一些。我使用 Inconsolata,这是我的 .emacs 中的一个片段:

(when window-system
  (set-face-attribute 'default
                      nil
                      :font "Inconsolata"
                      :height 120
                      :weight 'bold) ; <- this line does not affect rendering
  (require 'color-theme-solarized)
  (color-theme-solarized-dark)
  (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
                 '(2 "_NET_WM_STATE_FULLSCREEN" 0)))

我知道 Inconsolata 可以被渲染为粗体,但出于某种原因,Emacs 总是以正常的权重来渲染它。也许我应该在尝试更改字体之前启用某些功能?

最佳答案

不幸的是,原始 Inconsolata 没有粗体变体,应用程序通过增加字符宽度来模拟 Inconsolata Bold。这就是为什么可以在其中一些中使用 Inconsolata 的“粗体”变体。

根据 this Wikipedia article :

when Inconsolata was added to Google Fonts, it was fully hinted and a bold variant was added



因此,使用哪个版本的字体很重要。我已经删除了原来的 Inconsolata 并以这种方式安装了 Google 字体(Arch Linux):
# yaourt -S ttf-google-fonts-git

如果您遇到此类问题,请尝试为您的 Linux 发行版搜索类似的软件包。

关于emacs - 粗体属性不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25542061/

相关文章:

Emacs lisp - 如何尝试/捕获处理错误?

Emacs、Geiser 和 Chez Scheme 以及转录本

ios - 在 1place 的完整项目中快速设置不同样式的字体

c# - 如何处理 FormattedText/让 WPF 放弃 .TTF 文件?

html - 字体样式仅适用于标题

emacs - 为特定函数配置 emacs 变量

emacs - 从 elisp 加载动态库

emacs - 启用 Flyspell 模式会出现错误

emacs - 如何在组织模式议程 TreeView 中显示条目的完整上下文

emacs - 如何在 emacs 中禁用 Verilog 模式?