我在我的计算机上安装了 Fira Code 字体,但我无法像处理其他变体那样使用 fontconfig 来定位它的粗体变体。这是fc-match
给我的:
$ fc-match "Fira Code"
FiraCode_Regular.otf: "Fira Code" "Regular"
$ fc-match "Fira Code Light"
FiraCode_Light.otf: "Fira Code" "Light"
$ fc-match "Fira Code Medium"
FiraCode_Medium.otf: "Fira Code" "Medium"
$ fc-match "Fira Code Bold"
NotoSans-Regular.ttc: "Noto Sans" "Regular"
Run Code Online (Sandbox Code Playgroud)
Noto Sans 是我的后备字体,我认为这意味着它Fira Code Bold
与我的任何字体都不匹配。
但是,如果我fc-match
使用Fira Code:Bold
.
$ fc-match "Fira Code:Bold"
FiraCode_Bold.otf: "Fira Code" "Bold"
Run Code Online (Sandbox Code Playgroud)
在此问题之后,我创建了一个名为 inside 的文件30-fira-code-bold.conf
,~/.config/fontconfig/conf.d/
其中包含以下内容:
$ fc-match "Fira Code"
FiraCode_Regular.otf: "Fira Code" …
Run Code Online (Sandbox Code Playgroud)