1.选取字体
在/usr/share/fonts/truetype中新建一个目录,命名为ms,然后将Windowsfonts 目录下的tahoma.ttf、tahomabd.ttf(Tahoma的粗体)、simsun.ttc(宋体&新宋体,文件不用改名成ttf) 三个文件复制到该目录下;
2.编辑字体配置文件
在终端,进入/etc/fonts/目录,输入:sudo kate fonts.conf,使用kate打开配置文件,删除里面打全部内容(为了安全起见,可以先备份),输入以下内容:
<fontconfig> <alias> <family>serif</family> <prefer> <family>Bitstream Vera Serif</family> <family>DejaVu Serif</family> <family>SimSun</family> <family>AR PL ShanHeiSun Uni</family> <family>WenQuanYi Bitmap Song</family> <family>AR PL ZenKai Uni</family> </prefer> </alias> <alias> <family>sans-serif</family> <prefer> <family>Bitstream Vera Sans</family> <family>DejaVu Sans</family> <family>SimSun</family> <family>AR PL ShanHeiSun Uni</family> <family>WenQuanYi Bitmap Song</family> <family>AR PL ZenKai Uni</family> </prefer> </alias> <alias> <family>monospace</family> <prefer> <family>Bitstream Vera Sans Mono</family> <family>DejaVu Sans Mono</family> <family>AR PL ShanHeiSun Uni</family> <family>WenQuanYi Bitmap Song</family> <family>AR PL ZenKai Uni</family> </prefer> </alias> <match target="font"> <test name="family" compare="contains"> <string>Song</string> <string>Sun</string> <string>Kai</string> <string>Ming</string> </test> <test compare="more_eq" target="pattern" name="weight"> <int>180</int> </test> <edit mode="assign" name="embolden"> <bool>true</bool> </edit> </match> <!-- 以下部分主要是设置8-18px之间的中文字体的反抗锯齿功能,如果你喜欢抗锯齿,请不要使用 经测试,下面的文字应该要,去掉下面的字将变成粗体效果,还有点发虚。 --> <match target="font"> <test name="family" compare="contains"> <string>Song</string> <string>Sun</string> <string>Kai</string> <string>Ming</string> <string>SimSun</string> <string>宋体</string> </test> <edit name="globaladvance"> <bool>false</bool> </edit> <edit name="spacing"> <int>0</int> </edit> <edit name="hinting"> <bool>true</bool> </edit> <edit name="autohint"> <bool>false</bool> </edit> <edit name="antialias" mode="assign"> <bool>true</bool> </edit> <test name="pixelsize" compare="less_eq" qual="any"> <int>18</int> </test> <edit name="antialias" mode="assign"> <bool>false</bool> </edit> <test name="pixelsize" compare="more_eq"> <int>8</int> </test> <edit name="antialias" mode="assign"> <bool>false</bool> </edit> </match> </fontconfig>
3. 运行 sudo fc-cache -fv 刷新字体缓存;
4.系统配置-应用程序外观-字体,将字体全部设置为宋体即可。