record my way to ubuntu

Monday, August 14, 2006

设置字体显示:local.conf,firefox和系统字体

除了等宽字体使用Vera Sans YuanTi Mono外,其它都使用文泉驿字体。系统字体设置如图所示:

Vera Sans YuanTi Mono在显示等宽字体的情况下不会出现字体重迭的现象。如果仅仅这样设置,那么系统的英文字体也是文泉驿的宋体了。我觉得Ubuntu下的默认英文字体比较好看,为了让文泉驿和系统英文字体同时显示,需要修改/etc/fonts/local.conf文件。下面代码要加入该文件。系统安装完毕后,没有这个local.conf文件,自己要建一个。
<!-- Use Bitstream Vera Sans in Chinese Font -->
<match target="pattern" >
<test compare="eq" name="family" qual="any" >
<string>WenQuanYi Bitmap Song</string>
</test>
<edit mode="prepend_first" binding="strong" name="family" >
<string>Bitstream Vera Sans</string>
</edit>
</match>
有了以上代码,系统在使用文泉驿字体时,遇到英语字母会自动调用Bitstream Vera Sans字体。效果如图所示,同时使用文泉驿和Bitstream Vera Sans字体:

firefox的字体设置如下:


local.conf:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file for local customizations -->
<fontconfig>

<!-- Serif faces -->
<alias>
<family>DejaVu Serif</family>
<family>Bitstream Vera Serif</family>
<family>Times New Roman</family>
<family>Thorndale AMT</family>
<family>Times</family>
<family>Nimbus Roman No9 L</family>
<family>Luxi Serif</family>
<family>Kochi Mincho</family>
<family>WenQuanYi Bitmap Song</family>
<family>AR PL New Sung</family>
<family>Vera Sans YuanTi</family>
<family>AR PL SungtiL GB</family>
<family>AR PL Mingti2L Big5</family>
<family>MS 明朝</family>
<family>Baekmuk Batang</family>
<family>FreeSerif</family>
<family>MgOpen Canonica</family>
<default><family>serif</family></default>
</alias>

<!-- Sans-serif faces -->
<alias>
<family>DejaVu Sans</family>
<family>Bitstream Vera Sans</family>
<family>Helvetica</family>
<family>Arial</family>
<family>Verdana</family>
<family>Albany AMT</family>
<family>Nimbus Sans L</family>
<family>Luxi Sans</family>
<family>Kochi Gothic</family>
<family>WenQuanYi Bitmap Song</family>
<family>AR PL New Sung</family>
<family>Vera Sans YuanTi</family>
<family>AR PL KaitiM GB</family>
<family>AR PL KaitiM Big5</family>
<family>MS ゴシック</family>
<family>Baekmuk Dotum</family>
<family>SimSun</family>
<family>FreeSans</family>
<family>MgOpen Moderna</family>
<default><family>sans-serif</family></default>
</alias>

<!-- Monospace faces -->
<alias>
<family>DejaVu Sans Mono</family>
<family>Bitstream Vera Sans Mono</family>
<family>Courier</family>
<family>Courier New</family>
<family>Andale Mono</family>
<family>Luxi Mono</family>
<family>Cumberland AMT</family>
<family>Nimbus Mono L</family>
<family>Vera Sans YuanTi Mono</family>
<family>WenQuanYi Bitmap Song</family>
<family>AR PL New Sung</family>
<family>NSimSun</family>
<family>FreeMono</family>
<default><family>monospace</family></default>
</alias>

<!-- Use Bitstream Vera Sans in Chinese Font -->
<match target="pattern" >
<test compare="eq" name="family" qual="any" >
<string>WenQuanYi Bitmap Song</string>
</test>
<edit mode="prepend_first" binding="strong" name="family" >
<string>Bitstream Vera Sans</string>
</edit>
</match>

<!-- Disable font alias for Chinese <= 16px -->
<match target="font">
<test qual="any" name="family" compare="eq">
<string>WenQuanYi Bitmap Song</string>
<string>Vera Sans YuanTi</string>
<string>AR PL New Sung</string>
<string>AR PL Mingti2L Big5</string>
<string>AR PL SungtiL GB</string>
<string>MS 明朝</string>
<string>Kochi Mincho</string>
<string>Baekmuk Batang</string>
</test>
<test name="pixelsize" compare="less_eq">
<double>16</double>
</test>
<edit name="antialias">
<bool>false</bool>
</edit>
<edit name="hinting">
<bool>false</bool>
</edit>
</match>

</fontconfig>
可惜文泉驿没有大字体,显示我的Blog文章的标题就不能用大字体显示,看图吧:

No comments:

Followers