Ubuntu 所需要的中文字体美化操作步骤
中文字体美化是个很讨厌的事情,无数初学者在这里面浪费了无数时间,做了无数没有意义的事情。但这也是不得不做的,我把 Debian/Ubuntu 所需要的中文字体美化操作步骤详细记录在这里,希望能节约大家一部分时间。
1 安装必要的字体包
Debian 和 Ubuntu 下对中文支持比较好的字体有:ttf-droid
、ttf-wqy-zenhei
、fonts-noto
和 ttf-wqy-microhei
等,除了文泉驿系列字体外,比较流行的免费中文字体还有文鼎提供的楷体和上海宋,包名分别是:ttf-arphic-ukai
和 ttf-arphic-uming
。把这些字体都装上之后,应该就已经具备一个基本能用的中文环境了。
2 修改字体配置文件
在 Ubuntu Precise 之前,中文默认的字体配置效果已经非常好了。但到了 Precise 的时候,韩国新推出了几个免费韩文字体。当然了,免费字体这东西,本来就是多多宜善,但问题就在于,韩国人做的韩文字体里不仅仅有韩文,还包含了中文。而这些字体里的中文部分,不客气地说,实在是丑得可以。而韩国人把这个字体设置成 Ubuntu 里的中文默认字体,这就太让人难以接受了。
为了让中文显示效果更让人可以接受一些,滇狐决定完全屏蔽那几个韩文字体。反正滇狐不懂韩语,因此少了几个韩文字体,对正常生活影响不大了。大家可以参考以下滇狐自己的字体配置文件。将以下内容写到 ~/.config/fontconfig/fonts.conf
:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<alias>
<family>serif</family>
<prefer>
<family>Noto Serif</family>
<family>DejaVu Serif</family>
<family>Bitstream Vera Serif</family>
<family>Droid Serif</family>
<family>AR PL UMing CN</family>
<family>AR PL ShanHeiSun Uni</family>
<family>Droid Sans Fallback</family>
<family>WenQuanYi Micro Hei</family>
<family>WenQuanYi Zen Hei</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Roboto</family>
<family>Noto Sans</family>
<family>DejaVu Sans</family>
<family>Bitstream Vera Sans</family>
<family>Droid Sans</family>
<family>Droid Sans Fallback</family>
<family>WenQuanYi Micro Hei</family>
<family>WenQuanYi Zen Hei</family>
<family>AR PL UMing CN</family>
<family>AR PL ShanHeiSun Uni</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>DejaVu Sans Mono</family>
<family>Bitstream Vera Sans Mono</family>
<family>Droid Sans Mono</family>
<family>Droid Sans Fallback</family>
<family>WenQuanYi Micro Hei Mono</family>
<family>WenQuanYi Zen Hei Mono</family>
<family>AR PL UMing CN</family>
<family>AR PL ShanHeiSun Uni</family>
</prefer>
</alias>
<!-- Default Alias -->
<alias>
<family>Roboto</family>
<default>
<family>sans-serif</family>
</default>
</alias>
<!-- Generic font families -->
<match target="pattern">
<test name="family" qual="any">
<string>serif</string>
</test>
<edit binding="strong" mode="prepend" name="family">
<string>Noto Serif</string>
</edit>
</match>
<match target="pattern">
<test name="family" qual="any">
<string>sans-serif</string>
</test>
<edit
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<alias>
<family>serif</family>
<prefer>
<family>Noto Serif</family>
<family>DejaVu Serif</family>
<family>Bitstream Vera Serif</family>
<family>Droid Serif</family>
<family>AR PL UMing CN</family>
<family>AR PL ShanHeiSun Uni</family>
<family>Droid Sans Fallback</family>
<family>WenQuanYi Micro Hei</family>
<family>WenQuanYi Zen Hei</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Roboto</family>
<family>Noto Sans</family>
<family>DejaVu Sans</family>
<family>Bitstream Vera Sans</family>
<family>Droid Sans</family>
<family>Droid Sans Fallback</family>
<family>WenQuanYi Micro Hei</family>
<family>WenQuanYi Zen Hei</family>
<family>AR PL UMing CN</family>
<family>AR PL ShanHeiSun Uni</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>DejaVu Sans Mono</family>
<family>Bitstream Vera Sans Mono</family>
<family>Droid Sans Mono</family>
<family>Droid Sans Fallback</family>
<family>WenQuanYi Micro Hei Mono</family>
<family>WenQuanYi Zen Hei Mono</family>
<family>AR PL UMing CN</family>
<family>AR PL ShanHeiSun Uni</family>
</prefer>
</alias>
<!-- Default Alias -->
<alias>
<family>Roboto</family>
<default>
<family>sans-serif</family>
</default>
</alias>
<!-- Generic font families -->
<match target="pattern">
<test name="family" qual="any">
<string>serif</string>
</test>
<edit binding="strong" mode="prepend" name="family">
<string>Noto Serif</string>
</edit>
</match>
<match target="pattern">
<test name="family" qual="any">
<string>sans-serif</string>
</test>
<edit