两篇Linux下字体美化文章

50 views
Skip to first unread message

Leon Zhang

unread,
Feb 14, 2009, 12:07:26 PM2/14/09
to r01ustc...@blogger.com, r01ust...@blogger.com, rleon...@spaces.live.com, rui21...@blogger.com, GoogleGroups 杂七杂八, GoogleGroup日记, hktk posterous, scribblelive.天天向上, 海阔天空Blog, day-up...@spaces.live.com, rui.us...@blogger.com, r01ustc.upup
因为我不喜欢用圆体、雅黑之类的,看久了太累,所以只介绍怎么把字体设置得跟windows一样。

中文支持,如果在安装Ubuntu的时 候能上网,那么非常简单,直接选中文为缺省语言就都OK了,如果不能上网,则要在安装完重启后在系统管理/语言支持中再选中中文,进行安装(假设这时的网 络已经连通,这时会安装SCIM输入法),如果不喜欢ubuntu的某些软件的中文翻译,可以在usr/share/locale-langpack下手 动删除特定的翻译文件。
点阵字体,Windows的字体要比Linux下的字体好看,也比文泉驿的字体好看,安装Windows字体并美化的方法如下:
将 Windows下(在winnt/Fonts目录下)的simsun.ttc tahoma.ttf verdana.ttf verdanab.ttf verdanaz.ttf tahomabd.ttf verdanai.ttf拷贝到/usr/share/fonts/zh_CN,如果你的windows在hda1,那么可以用下面的命令:
cd /media/hda1/windows/fonts/
sudo cp simsun.ttc tahoma.ttf verdana.ttf verdanab.ttf verdanaz.ttf tahomabd.ttf verdanai.ttf /usr/share/fonts/zh_CN/
安装字体到系统中
cd /usr/share/fonts/zh_CN
sudo mkfontscale
sudo mkfontdir
sudo fc-cache
sudo chmod 755 * (或者644也行)
通过替换/etc/fonts/language-selector.conf来配置字体,只有这么配置后,才能达到美化的效果,不要更改/etc/fonts/fonts.conf。把下面的内容覆盖原language-selector.conf的内容。
<fontconfig>
<alias>
<family>serif</family>
<prefer>
<family>Bitstream Vera Serif</family>
<family>SimSun</family>
<family>DejaVu Serif</family>
<family>AR PL ShanHeiSun Uni</family>
<family>AR PL ZenKai Uni</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Bitstream Vera Sans</family>
<family>SimSun</family>
<family>DejaVu Sans</family>
<family>AR PL ShanHeiSun Uni</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>SimSun</family>
</prefer>
</alias>
<match target="font" >
<test compare="contains" >
<string>Song</string>
<string>Sun</string>
<string>Kai</string>
<string>Ming</string>
</test>
<test compare="more_eq" target="pattern" >
<int>180</int>
</test>
<edit mode="assign" >
<bool>true</bool>
</edit>
</match>
<match target="font" >
<test compare="contains" >
<string>Song</string>
<string>Sun</string>
<string>Kai</string>
<string>Ming</string>
</test>
<edit >
<bool>false</bool>
</edit>
<edit >
<int>0</int>
</edit>
<edit >
<bool>true</bool>
</edit>
<edit >
<bool>false</bool>
</edit>
<edit mode="assign">
<bool>true</bool>
</edit>
<test compare="less_eq">
<int>18</int>
</test>
<edit mode="assign" >
<bool>false</bool>
</edit>
</match>
<match target="pattern">
<test >
<string>SimSun</string>
<string>SimSun-18030</string>
<string>AR PL ShanHeiSun Uni</string>
<string>AR PL New Sung</string>
<string>MingLiU</string>
<string>PMingLiU</string>
</test>
<edit binding="strong" mode="prepend" >
<string>Tahoma</string>
<string>Verdana</string>
</edit>
</match>
<match target="pattern">
<test ><string>宋体</string></test>
<edit mode="assign"><string>SimSun</string></edit>
</match>
<match target="pattern">
<test ><string>新宋体</string></test>
<edit mode="assign"><string>SimSun</string></edit>
</match>
<match target="pattern">
<test ><string>仿宋_GB2312</string></test>
<edit mode="assign"><string>FangSong_GB2312</string></edit>
</match>
<match target="pattern">
<test ><string>楷体_GB2312</string></test>
<edit mode="assign"><string>KaiTi_GB2312</string></edit>
</match>
<match target="pattern">
<test ><string>黑体</string></test>
<edit mode="assign"><string>SimHei</string></edit>
</match>

</fontconfig>
现在可以设置GNOME的字体了,应用程序字体、文档字体、桌面字体均设为Tohoma,大小9;窗口标题字体设置为Tohoma Bold,大小9;等宽字体设为Dejavu sans mono book,大小10。字体渲染选单色

终端字体可以在终端的选项中单独设置,设置为NSimSun并适当设置大小效果比较好

同样,你也可以在firefox中设置字体。
原帖地址:
http://www.phyz.net/pukiwiki/index.php?Ubuntu%E5%AE%89%E8%A3%85%E4%B8%8E%E8%AE%BE%E7%BD%AE
另外还可参考:
http://forum.ubuntu.org.cn/about6623.html
http://forum.ubuntu.org.cn/about19325.html
http://forum.ubuntu.org.cn/about6623.html

喜欢雅黑的可参考:
http://forum.ubuntu.org.cn/about32339.html

使用windows字体美化Linux (普遍适用,以opensuse 10.3为例)
by ncforest
http://ncforest.blog.163.com
suse10.3用了方正字体,已经比较漂亮了。但是如果习惯了windows字体,可以用下面的方法:
1、把windows字体拷过去
sudo mkdir /usr/share/fonts/winfont
然后把下列字体拷进去
Arial
Arial Black
Arial Bold
Arial Itailc
Arial Bold Italic

Verdana
Verdana Bold
Verdana Italic
Verdana Bold Italic

Tahoma
Tahoma Bold

SimSun
SimHei
MingLIU

然后,新建文件local.conf ,并拷入/etc/fonts/,内容如下:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file to configure local fonts -->
<!-- author:kemean on 2007/02/23-->
<!--
    说明,这一套设置在GNome桌面和Firefox及其它GTK程序上都表现的很好,KDE中也还差不多,但Konqueror好像有自己的
    字体匹配技术,不太遵循fontconfig,所以在KDE中建议用Firefox浏览网页,这样的话GNome+KDE的中文环境都非常好了
-->
<fontconfig>

<!--
    注意:
    可能是因为优先顺序的调整,fcitx和mrxvt及fvwm的中文显示出了点问题,这里采用在Serif中添加文泉驿字体来解决

    1)Serif字体族中只有一个中文字体,WenQuanYi Bitmap Song
    2)修改~/.fcitx/config,设置中文字体为Serif,英文字体为Sans-Serif,匹配结果是:
    中文:WenQuanYi Bitmap Song;英文:Tahoma
    3)修改~/.mrxvt ,设置xftmFont(中文字体)为Serif,英文字体为Courier New,匹配结果是:
    中文:WenQuanYi Bitmap Song;英文:Courier New
    3)修改FVWM字体设置 ,设置xft字体为为Serif,匹配结果是:
    中文:WenQuanYi Bitmap Song;英文:WenQuanYi Bitmap Song
    设置方法:
    Menustyle * Font "StringEncoding=gbk-0:xft:Serif:size=10:encoding=iso10646-1"

    即,Serif做为patch 字体来用,中文以WenQuanYi Bitmap Song来解决。

-->

<!--
    直接拷在/usr/X11R6/etc/fonts/目录,不用修改fonts.conf


    注:Gnome字体设置对话框中的单位是pt,注意pt跟px之间的转换关系
    pt*dpi/inch=px    inch为72
    如:
    ?pt * 96 / 72 = ?px

    第一部分,字体优先设置和替换
-->
<!--
    字体别名设置,主要设置SimSun和NSimSun,设置之后后面的SimSun和
    NSimSun英文替换只用针对英文别名写,中文别名可以不写了。
-->
    <match target="pattern">
        <test name="family">
            <string>宋体</string>
        </test>
        <edit name="family" mode="assign">
            <string>SimSun</string>
        </edit>
    </match>
    <match target="pattern">
        <test name="family">
            <string>新宋体</string>
        </test>
        <edit name="family" mode="assign">
            <string>NSimSun</string>
        </edit>
    </match>


<!--
    Sans-serif 字体族
-->
    <alias>
        <family>Tahoma</family>
        <family>Verdana</family>
        <family>Arial</family>
        <family>Trebuchet MS</family>
        <family>Comic Sans MS</family>
        <family>SimSun</family>
        <family>SimHei</family>
        <family>FangSong_GB2312</family>
        <family>KaiTi_GB2312</family>
        <family>YouYuan</family>
        <family>LiSu</family>
        <family>STSong</family>
        <family>STZhongsong</family>
        <family>STXihei</family>
        <family>STFangsong</family>
        <family>STKaiti</family>
        <family>STXingkai</family>
        <family>STLiti</family>
        <family>STCaiyun</family>
        <family>STHupo</family>
        <family>STXinwei</family>
        <family>FZYaoTi</family>
        <family>FZShuTi</family>
        <family>Arial Unicode MS</family>
        <default><family>sans-serif</family></default>
    </alias>
<!--
    Serif 字体族
-->
    <alias>
        <family>Georgia</family>
        <family>Times New Roman</family>
        <family>WenQuanYi Bitmap Song</family>
        <default><family>serif</family></default>
    </alias>
<!--
    Monospace 字体族
-->
    <alias>
        <family>Courier New</family>
        <family>Andale Mono</family>
        <family>NSimSun</family>
        <default><family>monospace</family></default>
    </alias>


<!--
    把3个Adobe字体用MS中相对应的字体替换
-->
    <alias>
        <family>Times</family>
        <prefer>
            <family>Times New Roman</family>
        </prefer>
        <default><family>serif</family></default>
    </alias>
    <alias>
        <family>Helvetica</family>
        <prefer>
            <family>Arial</family>
        </prefer>
        <default><family>sans-serif</family></default>
    </alias>
    <alias>
        <family>Courier</family>
        <prefer>
            <family>Courier New</family>
        </prefer>
        <default><family>monospace</family></default>
    </alias>


<!--
    字体优先设置,越靠前越优先匹配
-->
    <alias>
        <family>sans-serif</family>
        <prefer>
            <family>Tahoma</family>
            <family>Verdana</family>
            <family>Arial</family>
            <family>Trebuchet MS</family>
            <family>Comic Sans MS</family>
            <family>SimSun</family>
            <family>SimHei</family>
            <family>FangSong_GB2312</family>
            <family>KaiTi_GB2312</family>
            <family>YouYuan</family>
            <family>LiSu</family>
            <family>STSong</family>
            <family>STZhongsong</family>
            <family>STXihei</family>
            <family>STFangsong</family>
            <family>STKaiti</family>
            <family>STXingkai</family>
            <family>STLiti</family>
            <family>STCaiyun</family>
            <family>STHupo</family>
            <family>STXinwei</family>
            <family>FZYaoTi</family>
            <family>FZShuTi</family>
            <family>Arial Unicode MS</family>
        </prefer>
    </alias>
    <alias>
        <family>serif</family>
        <prefer>
            <family>Georgia</family>
            <family>Times New Roman</family>
            <family>WenQuanYi Bitmap Song</family>
        </prefer>
    </alias>
    <alias>
        <family>monospace</family>
        <prefer>
            <family>Courier New</family>
            <family>Andale Mono</family>
            <family>NSimSun</family>
        </prefer>
    </alias>


<!--
    SimSun字体,英文部分用Tahoma替换,解决粗体英文破粹问题
    "宋体"不用再做设置,前面已用别名解决
-->
    <match target="pattern">
        <test name="family" >
            <string>SimSun</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Tahoma</string>
        </edit>
    </match>
<!--
    这里可以删除
    <match target="pattern">
        <test name="family" >
            <string>宋体</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Tahoma</string>
        </edit>
    </match>
-->


<!--
    NSimSun字体,英文部分用Courier New替换,解决粗体英文破粹问题,这样
    在firefox中查看源码时不会出现英文破粹
    "新宋体"不用再做设置,前面已用别名解决
-->
    <match target="pattern">
        <test name="family" >
            <string>NSimSun</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Courier New</string>
        </edit>
    </match>


<!--
    Courier 字体替换成 Courier New
-->
    <match target="pattern">
        <test name="family" >
            <string>Courier</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Courier</string>
        </edit>
    </match>


<!--
    针对Tahoma,Verdana字体,大号粗体显示太粗,
    这里我替换成Arial,临界值为20px(96 dpi 下15pt)
    15*96/72=20,注意下面的单位是像素pixelsize,可以
    测试后再换成其它值
-->
<!--
    <match target="pattern">
        <test name="family" >
            <string>Tahoma</string>
            <string>Verdana</string>
        </test>
        <test name="weight" compare="more_eq">
            <int>180</int>
        </test>
        <test name="pixelsize" compare="more_eq" >
            <double>20</double>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Arial</string>
        </edit>
    </match>
-->





<!--
    第二部分
    全局设置和调整,包括AA,HINT等
-->
<!--
    设置DPI,请设置成xdpyinfo | grep dot看到的DPI,也可以不设置。
-->
<!--
    <match target="pattern" >
        <edit name="dpi" mode="assign" >
            <double>96</double>
        </edit>
    </match>
-->


<!--
    子像素渲染设置,据需要而定,我的LCD就没开,设置为NONE,如果看到字体
    颜色有问题(如泛蓝,泛绿色等),请设置成rgb或其它值,具体参考man fonts-conf
-->
    <match target="font">
        <edit name="rgba" mode="assign">
            <const>none</const>
        </edit>
    </match>


<!--
    设置最小字体,所有字体都如此,英文优先是Tahoma 8pt
-->
    <match target="font" >
        <test name="pixelsize" compare="more_eq" >
            <double>8</double>
        </test>
        <test name="pixelsize" compare="less_eq" >
            <double>11</double>
        </test>
        <edit name="pixelsize" mode="assign" >
            <double>11</double>
        </edit>
    </match>


<!--
    设置CJK最小字体,主要体现为SimSun ,和上面的综合起来就是
    Tahoma 11px,SimSun 12px
    对应96 dpi 下的就是 8pt , 9pt
    具体临界值自己可以调整
-->
    <match target="font" >
        <test name="lang" compare="contains" >
            <string>zh</string>
            <string>ja</string>
            <string>ko</string>
        </test>
        <test name="pixelsize" compare="more_eq" >
            <double>8</double>
        </test>
        <test name="pixelsize" compare="less_eq" >
            <double>12</double>
        </test>
        <edit name="pixelsize" mode="assign" >
            <double>12</double>
        </edit>
    </match>


<!--
    支持伪斜体,从fonts.conf中粗过来的。
-->
    <match target="font">
        <!-- check to see if the font is roman -->
        <test name="slant">
            <const>roman</const>
        </test>
        <!-- check to see if the pattern requested non-roman -->
        <test target="pattern" name="slant" compare="not_eq">
            <const>roman</const>
        </test>
        <!-- multiply the matrix to slant the font -->
        <edit name="matrix" mode="assign">
            <times>
                <name>matrix</name>
                <matrix>
                    <double>1</double><double>0.2</double>
                    <double>0</double><double>1</double>
                </matrix>
            </times>
        </edit>
        <!-- pretend the font is oblique now -->
        <edit name="slant" mode="assign">
            <const>oblique</const>
        </edit>
    </match>


<!--
    支持伪粗体,从fonts.conf中粘过来的
-->
    <match target="font">
        <!-- check to see if the font is just regular -->
        <test name="weight" compare="less_eq">
            <int>100</int>
        </test>
        <!-- check to see if the pattern requests bold -->
        <test target="pattern" name="weight" compare="more_eq">
            <int>180</int>
        </test>
        <!-- set the embolden flag -->
        <edit name="embolden" mode="assign">
            <bool>true</bool>
        </edit>
    </match>


<!--
    默认AA设置
    针对自由字体,打开AA,AutoHint,关掉Hinting,样式为hintfull
    MS和CJK字体,下面专门调整
-->
    <match target="font" >
        <edit name="antialias" mode="assign" >
            <bool>true</bool>
        </edit>
        <edit name="autohint" mode="assign" >
            <bool>true</bool>
        </edit>
        <edit name="hinting" mode="assign" >
            <bool>false</bool>
        </edit>
        <edit name="hintstyle" mode="assign" >
            <const>hintfull</const>
        </edit>
    </match>


<!--
    解决中英文间距过大的问题
-->
    <match target="font">
        <test name="lang" compare="contains" >
            <string>zh</string>
            <string>ja</string>
            <string>ko</string>
        </test>
        <edit name="spacing" mode="assign" >
            <const>proportional</const>
        </edit>
        <edit name="globaladvance" mode="assign" >
            <bool>false</bool>
        </edit>
    </match>


<!--
    CJK字体AA设置,小于20px(96dpi 上是15pt)时不开AA
-->
    <match target="font" >
        <test name="lang" compare="contains" >
            <string>zh</string>
            <string>ja</string>
            <string>ko</string>
        </test>
        <test name="pixelsize" compare="more_eq" >
            <double>8</double>
        </test>
        <test name="pixelsize" compare="less_eq" >
            <double>20</double>
        </test>
        <edit name="antialias" mode="assign" >
            <bool>false</bool>
        </edit>
        <edit name="autohint" mode="assign" >
            <bool>false</bool>
        </edit>
        <edit name="hinting" mode="assign" >
            <bool>false</bool>
        </edit>
    </match>


<!--
    CJK字体AA设置,大于20px(96dpi 上是15pt)时开AA,AutoHint,Hinting
    采用hintfull,
    在我机器上autohint和hinting都开效果比较好,可以自己调整,一般两者只开一个,
    具体视情况而定
-->
    <match target="font" >
        <test name="lang" compare="contains" >
            <string>zh</string>
            <string>ja</string>
            <string>ko</string>
        </test>
        <test name="pixelsize" compare="more_eq" >
            <double>20</double>
        </test>
        <edit name="antialias" mode="assign" >
            <bool>true</bool>
        </edit>
        <edit name="autohint" mode="assign" >
            <bool>true</bool>
        </edit>
        <edit name="hinting" mode="assign" >
            <bool>true</bool>
        </edit>
    </match>


<!--
    如果是斜体CJK字体,打开AA,不喜欢可以把这一段删除掉或全部改成false
-->
    <match target="font">
        <test name="lang" compare="contains" >
            <string>zh</string>
            <string>ja</string>
            <string>ko</string>
        </test>
        <test name="slant" compare="not_eq">
            <const>roman</const>
        </test>
        <edit name="antialias" mode="assign" >
            <bool>true</bool>
        </edit>
        <edit name="autohint" mode="assign" >
            <bool>true</bool>
        </edit>
        <edit name="hinting" mode="assign" >
            <bool>true</bool>
        </edit>
    </match>


<!--
    微软字体设置
-->
<!--
    默认,打开AA和hint,不喜欢,可以全部改成false
-->
    <match target="font" >
        <test name="foundry" >
            <string>monotype</string>
            <string>microsoft</string>
        </test>
        <edit name="antialias" mode="assign" >
            <bool>false</bool>
        </edit>
        <edit name="autohint" mode="assign" >
            <bool>false</bool>
        </edit>
        <edit name="hinting" mode="assign" >
            <bool>true</bool>
        </edit>
        <edit name="hintstyle" mode="assign" >
            <const>hintfull</const>
        </edit>
    </match>



<!--
    如果是Courier New,打开AA,AutoHint,Hinting,不喜欢可以全部改成false
-->
    <match target="font" >
        <test name="family" >
            <string>Courier</string>
            <string>Courier New</string>
        </test>
        <edit name="antialias" mode="assign" >
            <bool>false</bool>
        </edit>
        <edit name="autohint" mode="assign" >
            <bool>false</bool>
        </edit>
        <edit name="hinting" mode="assign" >
            <bool>true</bool>
        </edit>
        <edit name="hintstyle" mode="assign" >
            <const>hintfull</const>
        </edit>
    </match>


<!--
    Courier New 字体大小设置
    这里设置最小为14.7px(96 dpi 上是11pt),可以依情况而定
-->
    <match target="font" >
        <test name="family" >
            <string>Courier New</string>
        </test>
        <test name="pixelsize" compare="less_eq" >
            <double>12</double>
        </test>
        <edit name="pixelsize" mode="assign" >
            <double>12</double>
        </edit>
    </match>



</fontconfig>

最后,sudo
fc-cache -fv
,然后字体设置中选择tahoma 9,firefox中也这样设就差不多了。

下面是使用微软雅黑的配置文件(Vista效果):

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file to configure local fonts -->
<!-- author:kemean on 2007/02/23-->

<fontconfig>


<!--
   Part 1:
   fonts prefer and substitution
-->
<!--
   fonts alias settings
-->
   <match target="pattern">
      <test name="family">
         <string>宋体</string>
      </test>
      <edit name="family" mode="assign">
         <string>SimSun</string>
      </edit>
   </match>
   <match target="pattern">
      <test name="family">
         <string>新宋体</string>
      </test>
      <edit name="family" mode="assign">
         <string>NSimSun</string>
      </edit>
   </match>
   <match target="pattern">
      <test name="family">
         <string>微软雅黑</string>
      </test>
      <edit name="family" mode="assign">
         <string>Microsoft Yahei</string>
      </edit>
   </match>
   <match target="pattern">
      <test name="family">
         <string>微软正黑体</string>
      </test>
      <edit name="family" mode="assign">
         <string>Microsoft JhengHei</string>
      </edit>
   </match>


<!--
   Mark common families with their generics so we'll get
   something reasonable
-->
<!--
   Sans-serif faces
-->
   <alias>
      <family>Tahoma</family>
      <family>Verdana</family>
      <family>Arial</family>
      <family>Trebuchet MS</family>
      <family>Comic Sans MS</family>
      <family>Microsoft YaHei</family>
      <family>SimSun</family>
      <family>SimHei</family>
      <family>FangSong_GB2312</family>
      <family>KaiTi_GB2312</family>
      <family>YouYuan</family>
      <family>LiSu</family>
      <family>STSong</family>
      <family>STZhongsong</family>
      <family>STXihei</family>
      <family>STFangsong</family>
      <family>STKaiti</family>
      <family>STXingkai</family>
      <family>STLiti</family>
      <family>STCaiyun</family>
      <family>STHupo</family>
      <family>STXinwei</family>
      <family>FZYaoTi</family>
      <family>FZShuTi</family>
      <family>Microsoft JhengHei</family>
      <family>Arial Unicode MS</family>
      <default><family>sans-serif</family></default>
   </alias>
<!--
   Serif faces
-->
   <alias>
      <family>Georgia</family>
      <family>Times New Roman</family>
      <family>YaHeiConsolas</family>
      <default><family>serif</family></default>
   </alias>
<!--
   Monospace faces
-->
   <alias>
      <family>Courier New</family>
      <family>Andale Mono</family>
      <family>Microsoft YaHei</family>
      <family>NSimSun</family>
      <default><family>monospace</family></default>
   </alias>


<!--
   Alias well known font names to MS TrueType fonts.
   These substitution TrueType faces for similar Type1
   faces to improve screen appearance.
-->
   <alias>
      <family>Times</family>
      <prefer>
         <family>Times New Roman</family>
      </prefer>
      <default><family>serif</family></default>
   </alias>
   <alias>
      <family>Helvetica</family>
      <prefer>
         <family>Arial</family>
      </prefer>
      <default><family>sans-serif</family></default>
   </alias>
   <alias>
      <family>Courier</family>
      <prefer>
         <family>Courier New</family>
      </prefer>
      <default><family>monospace</family></default>
   </alias>


<!--
   Provide required aliases for standard names
-->
   <alias>
      <family>sans-serif</family>
      <prefer>
         <family>Tahoma</family>
         <family>Verdana</family>
         <family>Arial</family>
         <family>Trebuchet MS</family>
         <family>Comic Sans MS</family>
         <family>Microsoft YaHei</family>
         <family>SimSun</family>
         <family>SimHei</family>
         <family>FangSong_GB2312</family>
         <family>KaiTi_GB2312</family>
         <family>YouYuan</family>
         <family>LiSu</family>
         <family>STSong</family>
         <family>STZhongsong</family>
         <family>STXihei</family>
         <family>STFangsong</family>
         <family>STKaiti</family>
         <family>STXingkai</family>
         <family>STLiti</family>
         <family>STCaiyun</family>
         <family>STHupo</family>
         <family>STXinwei</family>
         <family>FZYaoTi</family>
         <family>FZShuTi</family>
         <family>Microsoft JhengHei</family>
         <family>Arial Unicode MS</family>
      </prefer>
   </alias>
   <alias>
      <family>serif</family>
      <prefer>
         <family>Georgia</family>
         <family>Times New Roman</family>
         <family>YaHeiConsolas</family>
      </prefer>
   </alias>
   <alias>
      <family>monospace</family>
      <prefer>
         <family>Courier New</family>
         <family>Andale Mono</family>
         <family>Microsoft YaHei</family>
         <family>NSimSun</family>
      </prefer>
   </alias>


<!--
   SimSun english portion substitutionsubstitution
-->
   <match target="pattern">
      <test name="family" >
         <string>SimSun</string>
      </test>
      <edit name="family" mode="assign">
         <string>Microsoft YaHei</string>
      </edit>
      <edit name="family" mode="prepend" binding="strong">
         <string>Tahoma</string>
      </edit>
   </match>


<!--
   NSimSun english portion substitutionsubstitution
-->
   <match target="pattern">
      <test name="family" >
         <string>NSimSun</string>
      </test>
      <edit name="family" mode="assign">
         <string>Microsoft YaHei</string>
      </edit>
      <edit name="family" mode="prepend" binding="strong">
         <string>Courier New</string>
      </edit>
   </match>



<!--
   Courier substitution
-->
   <match target="pattern">
      <test name="family" >
         <string>Courier</string>
      </test>
      <edit name="family" mode="prepend" binding="strong">
         <string>Courier New</string>
      </edit>
   </match>


<!--
   Bold Tahoma/Verdana substitution:
   when its size more than 20px,substitution with Bold Arial
-->
   <match target="pattern">
      <test name="family" >
         <string>Tahoma</string>
         <string>Verdana</string>
      </test>
      <test name="weight" compare="more_eq">
         <int>180</int>
      </test>
      <test name="pixelsize" compare="more_eq" >
         <double>20</double>
      </test>
      <edit name="family" mode="prepend" binding="strong">
         <string>Arial</string>
      </edit>
   </match>





<!--
   Part 2:
   global settings and modify
-->
<!--
   Target dots per inch, change dpi to 96
-->
   <match target="pattern" >
      <edit name="dpi" mode="assign" >
         <double>96</double>
      </edit>
   </match>


<!--
   Enable sub-pixel rendering.
   If you are using CRT, set rgb -> none
-->
   <match target="font" >
      <edit name="rgba" mode="assign">
         <const>rgb</const>
      </edit>
   </match>


<!--
   Font size settings:
   set the apposite font size,so it's easy to be read
-->
   <match target="pattern" >
      <test name="pixelsize" compare="more_eq" >
         <double>8</double>
      </test>
      <test name="pixelsize" compare="less_eq" >
         <double>12</double>
      </test>
      <edit name="pixelsize" mode="assign" >
         <double>12</double>
      </edit>
   </match>


<!--
   Artificial oblique for fonts without an italic or oblique version
-->
   <match target="font" >
      <!-- check to see if the font is roman -->
      <test name="slant">
         <const>roman</const>
      </test>
      <!-- check to see if the pattern requested non-roman -->
      <test target="pattern" name="slant" compare="not_eq">
         <const>roman</const>
      </test>
      <!-- multiply the matrix to slant the font -->
      <edit name="matrix" mode="assign">
         <times>
            <name>matrix</name>
            <matrix>
               <double>1</double><double>0.2</double>
               <double>0</double><double>1</double>
            </matrix>
         </times>
      </edit>
      <!-- pretend the font is oblique now -->
      <edit name="slant" mode="assign">
         <const>oblique</const>
      </edit>
   </match>


<!--
   Synthetic emboldening for fonts that do not have bold face available
-->
   <match target="font" >
      <!-- check to see if the font is just regular -->
      <test name="weight" compare="less_eq">
         <int>100</int>
      </test>
      <!-- check to see if the pattern requests bold -->
      <test target="pattern" name="weight" compare="more_eq">
         <int>180</int>
      </test>
      <!-- set the embolden flag -->
      <edit name="embolden" mode="assign">
         <bool>true</bool>
      </edit>
   </match>


<!--
   Default Fonts setting
   here autohint = ture / hinting = false is for free fonts in your system
   we will use autohint = false / hinting = true for MS core fonts
-->
   <match target="font" >
      <edit name="antialias" mode="assign" >
         <bool>true</bool>
      </edit>
      <edit name="autohint" mode="assign" >
         <bool>true</bool>
      </edit>
      <edit name="hinting" mode="assign" >
         <bool>false</bool>
      </edit>
      <edit name="hintstyle" mode="assign" >
         <const>hintfull</const>
      </edit>
   </match>


<!--
   The dual-width Asian fonts (spacing=dual) are not rendered correctly,
   apparently FreeType forces all widths to match. Trying to disable the
   width forcing code by setting globaladvance=false alone doesn't  help.
   As a brute force workaround, also set spacing=proportional, i.e. handle
   them as proportional fonts:
-->
   <match target="font" >
      <test name="lang" compare="contains" >
         <string>zh</string>
         <string>ja</string>
         <string>ko</string>
      </test>
      <edit name="spacing" mode="assign" >
         <const>proportional</const>
      </edit>
      <edit name="globaladvance" mode="assign" >
         <bool>false</bool>
      </edit>
   </match>


<!--
   CJK antialias settings:
   when font size (in pixel) between 8 and 20px
-->
   <match target="font" >
      <test name="lang" compare="contains" >
         <string>zh</string>
         <string>ja</string>
         <string>ko</string>
      </test>
      <test name="pixelsize" compare="more_eq" >
         <double>8</double>
      </test>
      <test name="pixelsize" compare="less_eq" >
         <double>20</double>
      </test>
      <edit name="antialias" mode="assign" >
         <bool>false</bool>
      </edit>
      <edit name="autohint" mode="assign" >
         <bool>false</bool>
      </edit>
      <edit name="hinting" mode="assign" >
         <bool>false</bool>
      </edit>
      <edit name="hintstyle" mode="assign" >
         <const>hintnone</const>
      </edit>
   </match>


<!--
   CJK antialias settings:
   when font size (in pixel) more than 20px, enable AA.
-->
   <match target="font" >
      <test name="lang" compare="contains" >
         <string>zh</string>
         <string>ja</string>
         <string>ko</string>
      </test>
      <test name="pixelsize" compare="more_eq" >
         <double>20</double>
      </test>
      <edit name="antialias" mode="assign" >
         <bool>true</bool>
      </edit>
      <edit name="autohint" mode="assign" >
         <bool>true</bool>
      </edit>
      <edit name="hinting" mode="assign" >
         <bool>true</bool>
      </edit>
      <edit name="hintstyle" mode="assign" >
         <const>hintfull</const>
      </edit>
   </match>


<!--
   Italic CJK fonts,enable AA
-->
   <match target="font" >
      <test name="lang" compare="contains" >
         <string>zh</string>
         <string>ja</string>
         <string>ko</string>
      </test>
      <test name="slant" compare="not_eq">
         <const>roman</const>
      </test>
      <edit name="antialias" mode="assign" >
         <bool>true</bool>
      </edit>
      <edit name="autohint" mode="assign" >
         <bool>true</bool>
      </edit>
      <edit name="hinting" mode="assign" >
         <bool>true</bool>
      </edit>
      <edit name="hintstyle" mode="assign" >
         <const>hintfull</const>
      </edit>
   </match>


<!--
   Microsoft fonts settings
-->
<!--
   default : smoothed and hinted
-->
   <match target="font" >
      <test name="foundry" compare="contains" >
         <string>monotype</string>
         <string>microsoft</string>
      </test>
      <edit name="antialias" mode="assign" >
         <bool>true</bool>
      </edit>
      <edit name="autohint" mode="assign" >
         <bool>false</bool>
      </edit>
      <edit name="hinting" mode="assign" >
         <bool>true</bool>
      </edit>
      <edit name="hintstyle" mode="assign" >
         <const>hintfull</const>
      </edit>
   </match>


<!--
   Courier New:
   both enable autohint and hinting looks very well.
-->
   <match target="font" >
      <test name="family" compare="contains" >
         <string>Courier</string>
         <string>Courier New</string>
      </test>
      <edit name="antialias" mode="assign" >
         <bool>true</bool>
      </edit>
      <edit name="autohint" mode="assign" >
         <bool>true</bool>
      </edit>
      <edit name="hinting" mode="assign" >
         <bool>true</bool>
      </edit>
      <edit name="hintstyle" mode="assign" >
         <const>hintfull</const>
      </edit>
   </match>


<!--
   Courier New font size
-->
   <match target="font" >
      <test name="family" compare="eq" >
         <string>Courier New</string>
      </test>
      <test name="pixelsize" compare="less_eq" >
         <double>14.7</double>
      </test>
      <edit name="pixelsize" mode="assign" >
         <double>14.7</double>
      </edit>
   </match>


<!--
   Comic Sans MS font size
-->
<!--
   <match target="font" >
      <test name="family" compare="eq" >
         <string>Comic Sans MS</string>
      </test>
      <test name="pixelsize" compare="less_eq" >
         <double>14.7</double>
      </test>
      <edit name="pixelsize" mode="assign" >
         <double>14.7</double>
      </edit>
   </match>
-->

<!--
   <alias>
      <family>Comic Sans MS</family>
      <accept>
         <family>Microsoft YaHei</family>
      </accept>
   </alias>
-->

</fontconfig>

Reply all
Reply to author
Forward
0 new messages