Search This Blog

Ubuntu 中文字体美化方案大全 (4): 使用Windows Vista字体

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

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>Microsoft YaHei</string>
                        <string>YaHei Consolas Hybrid</string>
                </edit>
        </match>
        <match target="pattern">
                <test name="family" qual="any">
                        <string>sans-serif</string>
                </test>
                <edit binding="strong" mode="prepend" name="family">
                        <string>Microsoft YaHei</string>
                        <string>YaHei Consolas Hybrid</string>
                </edit>
        </match>
        <match target="pattern">
                <test name="family" qual="any">
                        <string>monospace</string>
                </test>
                <edit binding="strong" mode="prepend" name="family">
                        <string>YaHei Consolas Hybrid</string>
                        <string>Microsoft YaHei</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>Microsoft YaHei</family>
  </prefer>
 </alias>

 
        <match target="font">
  
                <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 mode="assign" name="antialias">
                        <bool>true</bool>
                </edit>
        </match>

 
        <match target="font">
  
                <test compare="contains" name="family">
   
                        <string>Tahoma</string>
                        <string>verdana</string>
                        <string>Arial</string>
                        <string>Times</string>
                        <string>Courier</string>
                </test>

  
                <test compare="more_eq" name="pixelsize">
                        <int>5</int>
                </test>

  
                <test compare="less_eq" name="pixelsize">
                        <int>18</int>
                </test>

  
                <edit mode="assign" name="antialias">
                        <bool>false</bool>
                </edit>
        </match>

</fontconfig>

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

[参考文献]

























No comments:

Post a Comment