Ubuntu 中文字体美化方案大全 (5): 使用苹果字体








首先,下载安装所需苹果字体,做好准备工作
然后,编辑下面两个文件:

1. /etc/fonts/conf.d/69-language-selector-zh-cn.conf
<fontconfig>

        <match target="pattern">
                <test name="family" qual="any">
                        <string>serif</string>
                </test>
                <edit binding="strong" mode="prepend" name="family">
                        <string>Lucida Grande</string>
                        <string>STHeiti</string>
                        <string>LiHei Pro</string>
                </edit>
        </match>
        <match target="pattern">
                <test name="family" qual="any">
                        <string>sans-serif</string>
                </test>
                <edit binding="strong" mode="prepend" name="family">
                        <string>Lucida Grande</string>
                        <string>STHeiti</string>
                        <string>LiHei Pro</string>
                </edit>
        </match>
        <match target="pattern">
                <test name="family" qual="any">
                        <string>monospace</string>
                </test>
                <edit binding="strong" mode="prepend" name="family">
   <string>Liberation Mono</string>
   <string>Courier New</string>
                        <string>YaHei Consolas Hybrid</string>
                </edit>
        </match>

</fontconfig>



2. /etc/fonts/conf.d/99-language-selector-zh.conf
<fontconfig>

 
        <match target="font">
                <test compare="contains" name="family">
                        <string>Song</string>
                        <string>Sun</string>
                        <string>Kai</string>
                        <string>Ming</string>
                        <string>Hei</string>
                        <string>LiSu</string>
                </test>
                
                <test compare="less_eq" name="weight">
                        <int>100</int>
                </test>
                <test compare="more_eq" name="weight" target="pattern">
                        <int>180</int>
                </test>
                <edit mode="assign" name="embolden">
                        <bool>true</bool>
                </edit>
        </match>

 
 <selectfont>
  <rejectfont>
   <pattern><patelt name="family"><string>SimSun</string></patelt></pattern>
  </rejectfont>
 </selectfont>
 <alias>
  <family>SimSun</family>
  <prefer>
   <family>STHeiti</family>
  </prefer>
 </alias>

 
 <match target="font">
  <test compare="contains" name="family">
   <string>Lucida Grande</string>
  </test>
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
  <edit mode="assign" name="autohint">
   <bool>false</bool>
  </edit>
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
  <edit mode="assign" name="hintstyle">
   <int>1</int>
  </edit>
 </match>

 
 <match target="font">
  <test compare="contains" name="family">
   <string>STHeiti</string>
   <string>LiHei Pro</string>
  </test>
  <edit mode="assign" name="hinting">  
   <bool>false</bool>
  </edit>
  <edit mode="assign" name="autohint">  
   <bool>false</bool>
  </edit>
  <edit mode="assign" name="antialias">  
   <bool>true</bool>
  </edit>
 </match>

</fontconfig>

最后,重启XWindow
  • Log out
  • Ctrl + Alt + Backspace 重启XWindow, 使配置生效

[参考文献]




























No comments:

Post a Comment