1、创建或编辑字体配置文件:
创建或编辑
文件,以确保配置只影响当前用户。文件内容如下:~/.config/fontconfig/fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>sans-serif</family>
<prefer>
<family>Microsoft YaHei</family>
<family>Noto Sans CJK SC</family>
<family>WenQuanYi Micro Hei</family>
<family>DejaVu Sans</family>
<family>SimSun</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>Microsoft YaHei</family>
<family>Noto Serif CJK SC</family>
<family>WenQuanYi Micro Hei</family>
<family>DejaVu Serif</family>
<family>SimSun</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Microsoft YaHei</family>
<family>Noto Mono</family>
<family>WenQuanYi Micro Hei Mono</family>
<family>DejaVu Sans Mono</family>
<family>SimSun</family>
</prefer>
</alias>
</fontconfig>
这里将Microsoft YaHei(微软雅黑)放在首位,以便优先显示中文时使用微软雅黑字体。
2、更新字体缓存:
运行以下命令来更新字体缓存:
fc-cache -fv