updated on Thu Jan 12 04:00:44 UTC 2012
[aur-mirror.git] / fontconfig-ms-fonts-zh / 18-ttf-ms-fonts-zh-common.conf
blob54214e31029d71fe33059ba64a84df24541967bc
1 <?xml version="1.0"?>
2 <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
4 <!-- configure CJK font access -->
5 <fontconfig>
7 <!--
8 Enable sub-pixel rendering.
9 If you are using CRT, set rgb -> none
10 -->
11 <match target="font" >
12 <edit name="rgba" mode="assign" >
13 <const>rgb</const>
14 </edit>
15 </match>
17 <!--
18 default : smoothed and hinted
19 -->
20 <match target="font" >
21 <edit name="rgba" mode="assign"><const>rgb</const></edit>
22 <edit name="antialias" mode="assign" ><bool>true</bool></edit>
23 <edit name="autohint" mode="assign" ><bool>true</bool></edit>
24 <edit name="hinting" mode="assign" ><bool>false</bool></edit>
25 <edit name="hintstyle" mode="assign" ><const>hintslight</const></edit>
26 <!-- <edit name="embeddedbitmap" ><bool>false</bool></edit> -->
27 </match>
29 <!--
30 For point size less equal than 6 : only smoothed
31 -->
32 <match target="font" >
33 <test name="size" compare="less_eq" ><double>6</double></test>
34 <edit name="antialias" mode="assign" ><bool>true</bool></edit>
35 <edit name="autohint" mode="assign" ><bool>false</bool></edit>
36 <edit name="hinting" mode="assign" ><bool>false</bool></edit>
37 </match>
39 <!--
40 Don't use embedded bitmap glyph to simulate italic style,
41 tell xft to use vector data to simulate it
42 -->
43 <match target="font">
44 <test target="pattern" name="slant"><const>roman</const></test>
45 <test target="font" name="slant" compare="not_eq"><const>roman</const></test>
46 <edit name="embeddedbitmap" mode="assign" ><bool>false</bool></edit>
47 </match>
49 <!--
50 Synthetic emboldening for Chinese fonts that do not have bold face available
51 -->
52 <match target="font" >
53 <test name="family" compare="contains" >
54 <string>Song</string>
55 <string>Sun</string>
56 <string>Kai</string>
57 <string>Ming</string>
58 </test>
59 <test target="pattern" name="weight" compare="more_eq">
60 <int>180</int>
61 </test>
62 <edit name="embolden" mode="assign" >
63 <bool>true</bool>
64 </edit>
65 </match>
67 <!--
68 The dual-width Asian fonts (spacing=dual) are not rendered correctly,
69 apparently FreeType forces all widths to match. Trying to disable the
70 width forcing code by setting globaladvance=false alone doesn't help.
71 As a brute force workaround, also set spacing=proportional, i.e. handle
72 them as proportional fonts: CJK 双宽度纠正
73 -->
74 <match target="font" >
75 <test target="pattern" name="lang" compare="contains" >
76 <string>zh</string>
77 <string>ja</string>
78 <string>ko</string>
79 </test>
80 <test name="spacing" compare="eq"><const>dual</const></test>
81 <edit name="spacing" mode="assign" ><const>proportional</const></edit>
82 <edit name="globaladvance" mode="assign" ><bool>false</bool></edit>
83 </match>
85 <!--
86 There is a similar problem with dual width bitmap fonts. They don't
87 have spacing=dual, therefore they are not handled by the above rule
88 and still display as charcell fonts. For example "Efont Biwidth"
89 has spacing=mono and "Misc Fixed Wide" has spacing=charcell.
90 Force handling of these fonts as proportional fonts as well:
91 -->
92 <match target="font">
93 <test name="lang" compare="contains">
94 <string>zh</string>
95 <string>ja</string>
96 <string>ko</string>
97 </test>
98 <test name="outline" compare="eq"><bool>false</bool></test>
99 <test name="spacing" compare="eq">
100 <const>mono</const>
101 <const>charcell</const>
102 </test>
103 <edit name="spacing"><const>proportional</const></edit>
104 <edit name="globaladvance" binding="strong"><bool>false</bool></edit>
105 </match>
106 <!--
107 Synthetic emboldening for Chinese fonts that do not have bold face available
108 为不带粗体的中文字体机器合成粗体
110 <match target="font" >
111 <!-- check to see if the font is just regular -->
112 <test name="weight" compare="less_eq"><const>medium</const></test>
113 <!-- check to see if the pattern requests bold -->
114 <test target="pattern" name="weight" compare="more"><const>medium</const></test>
115 <!--
116 set the embolden flag
117 needed for applications using cairo, e.g. gucharmap, gedit, ...
119 <edit name="embolden" mode="assign" ><bool>true</bool></edit>
120 <!--
121 set weight to bold
122 needed for applications using Xft directly, e.g. Firefox, ...
124 <edit name="weight" mode="assign"><const>bold</const></edit>
125 </match>
127 </fontconfig>