一般终端只能设置一种字体,不会为了中英文字体各给出一个配置项。为了让中英文字体能够匹配设置,编辑文件~/.config/fontconfig/fonts.conf
。
这里假定配置如下:
- 英文字体:DejaVu Sans Mono
- 中文字体:Source Han Sans SC
将下面代码插入到文件中:
<match>
<test name="lang" compare="contains">
<string>zh</string>
</test>
<test name="family">
<string>DejaVu Sans Mono</string>
</test>
<edit name="family" mode="prepend">
<string>Source Han Sans SC</string>
</edit>
</match>
重新登录即可实现中英两种字体的匹配设置。