解决Ubuntu图形界面因为CJK字体显示优先级不同导致简体中文显示异常问题
posts/%E8%A7%A3%E5%86%B3ubuntu%E5%9B%BE%E5%BD%A2%E7%95%8C%E9%9D%A2%E5%9B%A0%E4%B8%BAcjk%E5%AD%97%E4%BD%93%E6%98%BE%E7%A4%BA%E4%BC%98%E5%85%88%E7%BA%A7%E4%B8%8D%E5%90%8C%E5%AF%BC%E8%87%B4%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%E6%98%BE%E7%A4%BA%E5%BC%82%E5%B8%B8%E9%97%AE%E9%A2%98由于系统默认中文字体使用的是日文字形的中文字体所以导致部分中文字体显示异常影响正常阅读,所以需要调整下字体优先级
字体文件配置目录/etc/fonts/conf.d/64-language-selector-prefer.conf
vim 编辑字体配置文件
$ sudo vim /etc/fonts/conf.d/64-language-selector-prefer.conf
将每个alias
标签family
中的Noto Sans CJK SC
调置最前
原64-language-selector-prefer.conf
文件
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>sans-serif</family>
<prefer>
<family>Noto Sans CJK JP</family>
<family>Noto Sans CJK KR</family>
<family>Noto Sans CJK SC</family>
<family>Noto Sans CJK TC</family>
<family>Noto Sans CJK HK</family>
<family>Lohit Devanagari</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>Noto Serif CJK JP</family>
<family>Noto Serif CJK KR</family>
<family>Noto Serif CJK SC</family>
<family>Noto Serif CJK TC</family>
<family>Lohit Devanagari</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Noto Sans Mono CJK JP</family>
<family>Noto Sans Mono CJK KR</family>
<family>Noto Sans Mono CJK SC</family>
<family>Noto Sans Mono CJK TC</family>
<family>Noto Sans Mono CJK HK</family>
</prefer>
</alias>
</fontconfig>
修改后64-language-selector-prefer.conf
文件
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>sans-serif</family>
<prefer>
<family>Noto Sans CJK SC</family>
<family>Noto Sans CJK JP</family>
<family>Noto Sans CJK KR</family>
<family>Noto Sans CJK TC</family>
<family>Noto Sans CJK HK</family>
<family>Lohit Devanagari</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>Noto Serif CJK SC</family>
<family>Noto Serif CJK JP</family>
<family>Noto Serif CJK KR</family>
<family>Noto Serif CJK TC</family>
<family>Lohit Devanagari</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Noto Sans Mono CJK SC</family>
<family>Noto Sans Mono CJK JP</family>
<family>Noto Sans Mono CJK KR</family>
<family>Noto Sans Mono CJK TC</family>
<family>Noto Sans Mono CJK HK</family>
</prefer>
</alias>
</fontconfig>
最后重启系统字体恢复完毕