|
|
发表于 2006-4-5 23:57:02
|
显示全部楼层
给楼主参考一下我的.fonts.conf, 楼主酌情修改吧
- <?xml version="1.0"?>
- <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
- <fontconfig>
- <!-- better no trailing slash -->
- <dir>/hoard/fonts/fonts.using</dir>
- <!--
- ****************************************************************
- the default fonts.conf shipped recognize simsun as sans family,
- while in fact it is of the serif family.
- ****************************************************************
- -->
- <match target="pattern">
- <!-- check to see if simsun is among the family list -->
- <test name="family" qual="any" compare="contains">
- <string>SimSun</string>
- </test>
- <!-- if so, locate the 'sans-serif' inserted by fonts.conf -->
- <test name="family" qual="any" compare="eq">
- <string>sans-serif</string>
- </test>
- <!-- now replace the located 'sans-serif' with 'serif' -->
- <edit name="family" mode="assign">
- <string>serif</string>
- </edit>
- </match>
- <!--
- ****************************************************************
- I don't like arphic fonts. so remove any relavent request
- ****************************************************************
- -->
- <!-- replace arphic serifs with simsun -->
- <match target="pattern">
- <test name="family" qual="any" compare="contains">
- <string>AR PL SungtiL GB</string>
- <string>AR PL Mingti2L Big5</string>
- </test>
- <edit name="family" mode="assign">
- <string>SimSun</string>
- </edit>
- </match>
- <!-- replace arphic sans with Yuanti -->
- <match target="pattern">
- <test name="family" qual="any" compare="contains">
- <string>AR PL KaitiM GB</string>
- <string>AR PL KaitiM Big5</string>
- </test>
- <edit name="family" mode="assign">
- <string>Vera Sans YuanTi</string>
- </edit>
- </match>
- <!--
- ****************************************************************
- Since the system adds the prefer list after reading user conf,
- we'll have to choose our own prefer list so that ours are
- inserted before the system's
-
- The rationale for the prefer list:
-
- that some beautiful opensource english fonts shall go first,
- then go micro$oft corefonts, then chinese fonts.
- ****************************************************************
- -->
- <!-- serif -->
- <alias>
- <family>serif</family>
- <prefer>
- <!-- open source first -->
- <family>Bitstream Vera Serif</family>
- <!-- m$ fonts -->
- <family>Times New Roman</family>
- <!-- now chinese fonts -->
- <family>SimSun</family>
- </prefer>
- </alias>
- <!-- sans -->
- <alias>
- <family>sans-serif</family>
- <prefer>
- <!-- oss fonts -->
- <family>Bitstream Vera Sans</family>
- <!-- m$ fonts -->
- <family>Verdana</family>
- <family>Arial</family>
- <!-- chinese fonts -->
- <family>Vera Sans YuanTi</family>
- <!-- fall back to serif in case yuanti doesnt cover certain
- chars -->
- <family>SimSun</family>
- </prefer>
- </alias>
- <!-- mono -->
- <alias>
- <family>monospace</family>
- <prefer>
- <family>Bitstream Vera Sans Mono</family>
- <!-- m$ -->
- <family>Andale Mono</family>
- <family>Courier New</family>
- <!-- chs -->
- <family>Vera Sans YuanTi Mono</family>
- <family>NSimSun</family>
- </prefer>
- </alias>
- <!--
- ****************************************************************
- where appropriate, we use wqy's song since its latin chars are
- more appealing
- ****************************************************************
- -->
- <match target="pattern">
- <test name="family"><string>SimSun</string></test>
- <test qual="all" name="pixelsize" compare="more_eq">
- <double>12</double>
- </test>
- <test qual="all" name="pixelsize" compare="less_eq">
- <double>18</double>
- </test>
- <edit name="family" mode="prepend">
- <string>WenQuanYi Bitmap Song</string>
- </edit>
- </match>
- <!--
- ****************************************************************
- the globaladvance thing. see corresponding part in the default
- fonts.conf
- ****************************************************************
- -->
- <match target="font">
- <test name="family" compare="contains">
- <string>SimSun</string>
- <string>WenQuanYi</string>
- <string>YuanTi</string>
- <!-- add more fonts here -->
- </test>
- <edit name="globaladvance"><bool>false</bool></edit>
- </match>
-
- <!--
- ****************************************************************
- synthetic emboldening. The corresponding part in fonts.conf
- almost never works, since it seems when the 'embolden' flag was
- on, libXft needs "weight" as a parameter: the "weight" as to
- "embolden" is like "matrix" as to "slant" flag in artificial
- oblique. After all, libXft had to know something about to which
- extent the emboldening should be applied.
- ****************************************************************
- -->
- <match target="font">
- <test target="pattern" name="weight" compare="more_eq">
- <int>180</int></test>
- <!-- the following test on returned weight won't work in the case
- that we conditionally substitute simsun with wqy. Take
- linuxsir as an example, when text size is set to the wqy
- regime, the font itself has a bold face, and thus bypasses
- the test. when the size is enlarged, at least in firefox
- simsun doesn't get emboldened. but when the test is on
- "style", all seems working
-
- <test name="weight" compare="less"><int>200</int></test>
- -->
- <test name="style" compare="contains">
- <string>regular</string></test>
- <!-- set the embolden flag -->
- <edit name="embolden" mode="assign">
- <bool>true</bool>
- </edit>
- <!-- the part that fonts.conf missed -->
- <edit name="weight" mode="assign">
- <!-- unfortunately, we have no way to know what is the weight
- in the pattern requested, so we have to compose one on
- ourselves -->
- <int>200</int>
- </edit>
- <!-- and if you want to be a gentleman, also set the "style" to
- "bold" -->
- <!--
- <edit name="style" mode="assign">
- <const>bold</const>
- </edit>
- -->
- </match>
- <!-- disable AA of chinese fonts from 12 to 18-->
- <match target="font">
- <test name="lang" compare="contains">
- <string>zh</string></test>
- <test name="pixelsize" compare="more_eq">
- <double>12</double></test>
- <test name="pixelsize" compare="less_eq">
- <double>18</double></test>
- <edit name="antialias"><bool>false</bool></edit>
- <edit name="hinting"><bool>true</bool></edit>
- </match>
- </fontconfig>
复制代码 |
|