1. 将雅黑字体复制到/usr/share/fonts
sudo cp msyhbd.ttf msyh.ttf /usr/share/fonts/truetype
将这2个文件的属性改成755
sudo chmod 755 /usr/share/fonts/truetype/msyh
2. 执行如下命令
sudo fontconfig-voodoo -f -s zh_CN
sudo gedit /etc/fonts/language-selector.conf
找到:<family>Bitstream Vera Serif</family>下面一行添加:
<family>Microsoft YaHei</family>
在<family>Bitstream Vera Sans</family>下面一行添加:
<family>Microsoft YaHei</family>
3. sudo fc-cache -f -v
4. 打开"系统-首选项-字体"面板,选择字体为STHeiti
5. 打开sudo gedit /etc/fonts/fonts.conf文件,找到以
<match target="font">
<test name="family">
<string>Microsoft YaHei</string>
</test>
<edit name="hinting">
<bool>false</bool>
</edit>
</match>
也可以使用sudo fc-cache -f -v命令刷新一下字体缓存,,完成。重启x看效果。
6.注意的问题,在加入第5步操作的时候,一定要注意 原来的语法格式<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>
<!--
DO NOT EDIT THIS FILE.
IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
LOCAL CHANGES BELONG IN 'local.conf'.
The intent of this standard configuration file is to be adequate for
most environments. If you have a reasonably normal environment and
have found problems with this configuration, they are probably
things that others will also want fixed. Please submit any
problems to the fontconfig bugzilla system located at fontconfig.org
Note that the nor