自己调的一个fontconfig,以ms字体和华文字体为主,在我自己的LCD上还是很好看而且很清晰的。
Posted on 2009-04-04 14:55 wanderxjtu 阅读(486) 评论(0) 编辑 收藏 举报Code
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file to configure local fonts -->
<fontconfig>
<!--
fonts alias substitution
-->
<match target="pattern">
<test name="family" compare="eq">
<string>宋体</string>
</test>
<edit name="family" mode="assign">
<string>STZhongsong</string>
</edit>
</match>
<match target="pattern">
<test name="family" compare="eq">
<string>黑体</string>
</test>
<edit name="family" mode="assign">
<string>STHeiti</string>
</edit>
</match>
<match target="pattern">
<test name="family" compare="eq">
<string>华文黑体</string>
</test>
<edit name="family" mode="assign">
<string>STHeiti</string>
</edit>
</match>
<match target="pattern">
<test name="family" compare="eq">
<string>新宋体</string>
</test>
<edit name="family" mode="assign">
<string>NSimSun</string>
</edit>
</match>
<!--
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>Nimbus Sans L</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>
<!--
Mark common families with their generics so we'll get
something reasonable
-->
<!--
Sans-serif faces
-->
<alias>
<family>Segoe UI</family>
<family>Trebuchet MS</family>
<family>Helvetica</family>
<family>Verdana</family>
<family>Lucida Sans</family>
<family>DejaVu Sans</family>
<family>Microsoft YaHei</family>
<family>STHeiti</family>
<family>WenQuanYi Zen Hei</family>
<default><family>sans-serif</family></default>
</alias>
<!--
Serif faces
-->
<alias>
<family>Nimbus Roman No9 L</family>
<family>Times New Roman</family>
<family>DejaVu Serif</family>
<family>Georgia</family>
<family>STZhongsong</family>
<family>AR PL SungtiL GB</family>
<default><family>serif</family></default>
</alias>
<!--
Monospace faces
-->
<alias>
<family>Monaco</family>
<family>DejaVu Mono</family>
<family>Nimbus Mono L</family>
<family>Courier Std</family>
<family>STHeiti</family>
<family>Microsoft YaHei</family>
<default><family>monospace</family></default>
</alias>
<!--
Provide required aliases for standard names
-->
<match target="pattern">
<test name="family" compare="eq">
<string>sans-serif</string>
</test>
<edit name="family" mode="assign" binding="strong">
<string>Segoe UI</string>
<string>Microsoft YaHei</string>
</edit>
</match>
<match target="pattern">
<test name="family" compare="eq">
<string>serif</string>
</test>
<edit name="family" mode="assign" binding="strong">
<string>STZhongsong</string>
</edit>
</match>
<match target="pattern">
<test name="family" compare="eq">
<string>monospace</string>
</test>
<edit name="family" mode="assign" binding="strong">
<string>Monaco</string>
<string>STHeiti</string>
</edit>
</match>
<!--
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>
<!--
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>
<!--
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>
<!--
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>13</double>
</test>
<edit name="pixelsize" mode="assign">
<double>13</double>
</edit>
</match>
-->
<!--
Default Fonts hinting setting
freefonts with hintslight looks good
-->
<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>true</bool>
</edit>
<edit name="hintstyle" mode="assign">
<const>hintslight</const>
</edit>
<edit name="embeddedbitmap" mode="assign" >
<bool>false</bool>
</edit>
</match>
<!--
microsoft, monotype & adobe fonts hinting settings
default : same as above, but bold fonts with hintslight looks better
-->
<match target="font">
<test name="foundry" compare="contains">
<string>monotype</string>
<string>microsoft</string>
<string>adobe</string>
</test>
<edit name="autohint" mode="assign">
<bool>false</bool>
</edit>
<edit name="hintstyle" mode="assign">
<const>hintfull</const>
</edit>
<test name="weight" compare="more_eq">
<int>180</int>
</test>
<edit name="autohint" mode="assign">
<bool>false</bool>
</edit>
<edit name="hintstyle" mode="assign">
<const>hintslight</const>
</edit>
</match>
<!--
YaHei STHeiti and Monaco fonts hinting settings
-->
<match target="font">
<test name="family" compare="contains">
<string>ST</string>
<string>YaHei</string>
<string>JhengHei</string>
<string>Monaco</string>
</test>
<edit name="autohint" mode="assign">
<bool>false</bool>
</edit>
<edit name="antialias" mode="assign">
<bool>true</bool>
</edit>
<edit name="hintstyle" mode="assign">
<const>hintfull</const>
</edit>
</match>
<!--
STHeiti and Monaco fonts hinting settings
-->
<match target="font">
<test name="family" compare="contains">
<string>STHeiti</string>
<string>STZhongsong</string>
</test>
<edit name="autohint" mode="assign">
<bool>true</bool>
</edit>
<edit name="antialias" mode="assign">
<bool>true</bool>
</edit>
<edit name="hintstyle" mode="assign">
<const>hintfull</const>
</edit>
</match>
<match target="font" >
<test qual="any" name="family" compare="eq" >
<string>SimSun</string>
<string>NSimSun</string>
<string>MingLiU</string>
<string>PMingLiU</string>
</test>
<test name="pixelsize" compare="more_eq" >
<double>18</double>
</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>
<!--
SimSun english portion substitution
-->
<match target="pattern">
<test name="family">
<string>SimSun</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Times New Roman</string>
</edit>
</match>
<!--
SimHei english portion substitution
-->
<match target="pattern">
<test name="family">
<string>SimHei</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>DejaVu Sans</string>
</edit>
</match>
<!--
NSimSun english portion substitution
-->
<match target="pattern">
<test name="family">
<string>NSimSun</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Courier Std</string>
</edit>
</match>
</fontconfig>