<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- conf.d/10-myfonts -->
<fontconfig>
 <dir>/usr/share/fonts</dir>
 <dir>/usr/local/share/fonts</dir>
 <dir>~/.fonts</dir>
<!--Add the fonts path-->
<dir>/usr/share/fonts/TTF</dir>

<!--  
For Chinese bold fonts,we need "freetype,fontconfig,libXft" work together
  -->

     <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 settings for all fonts.
-->
<match target="font" >
<!-- enable anti-alias,big fonts need AA   -->
		<edit mode="assign" name="antialias" >
			<bool>t</bool>
		</edit>
		<edit mode="assign" name="hintstyle" >
			<const>hintslight</const>
		</edit>
<!-- enable hint  -->
		<edit mode="assign" name="hinting" >
			<bool>t</bool>
		</edit>
<!-- disable autohint  -->
		<edit mode="assign" name="autohint" >
			<bool>false</bool>
		</edit>
</match>


<!-- disable anti-alias for 8-17 size fonts -->
 <match target="font" >
                <!--
                <test compare="contains" name="lang" >
                        <string>zh-cn</string>
                        <string>zh-tw</string>
                        <string>ja</string>
                        <string>ko</string>
                </test>
                -->
                <test compare="more_eq" name="pixelsize" qual="any" >
                        <double>8</double>
                </test>
                <test compare="less_eq" name="pixelsize" qual="any" >
                        <double>17</double>
                </test>
                <edit mode="assign" name="antialias" >
                        <bool>false</bool>
                </edit>
</match>

<!-- the space between English fonts is too wide,solve this problem -->
<match target="font"> 

                <test target="pattern" name="lang" compare="contains"> 
                        <string>zh-tw</string> 
                        <string>zh-cn</string> 
                        <string>ja</string> 
                        <string>ko</string> 
                </test> 
                <edit name="spacing"> 
                        <const>proportional</const> 
                </edit> 
                <edit name="globaladvance"> 
                <bool>false</bool> 
                </edit> 
</match>

<!--
 define the smallest size of Chinese fonts
-->
  <match target="font" >
	<test name="family" qual="any" >
		<string>SimSun</string>
		<string>NSimSun</string>
		<string>SimHei</string>
		<string>AR PL ShanHeiSun Uni</string>
		<string>AR PL ZenKai Uni</string>
		<string>AR PL New Sung</string>
		<string>FZSongTi</string>
	 	<string>FZMingTiB</string>
		<string>FangSong_GB2312</string>
		<string>KaiTi_GB2312</string>
	</test>
	<test compare="more_eq" name="pixelsize" >
		<int>8</int>
	</test>
	<test compare="less_eq" name="pixelsize" >
		<int>12</int>
	</test>
	<edit compare="eq" name="pixelsize" >
		<int>12</int>
	</edit>
 </match>
<!--
  sort the family of "serif ,sans,monospace",make it fit to Chinese people
-->
   <alias>
      <family>serif</family>
      <prefer>
         <family>Times New Roman</family>
         <family>Nimbus Roman No9 L</family>
         <family>Luxi Serif</family>
         <family>Times</family>
	 <family>Bitstream Vera Serif</family>
         <family>Simsun</family>
	 <family>MingLiu</family>
         <family>WenQuanYi Bitmap Song</family>
	 <family>AR PL ShanHeiSun Uni</family>
	 <family>AR PL ZenKai Uni</family>
         <family>AR PL New Sung</family>
	 <family>FZSongTi</family>
	 <family>FZMingTiB</family>
         <family>Kochi Mincho</family>
         <family>AR PL SungtiL GB</family>
         <family>AR PL Mingti2L Big5</family>
         <family>Baekmuk Batang</family>
      </prefer>
   </alias>
   <alias>
      <family>sans-serif</family>
      <prefer>
	 <family>Arial</family>
	 <family>Verdana</family>
	 <family>Tahoma</family>
	 <family>Helvetica</family>
	 <family>Bitstream Vera Sans</family>
         <family>SimSun</family>
	 <family>MingLiu</family>
         <family>WenQuanYi Bitmap Song</family>
	 <family>AR PL ShanHeiSun Uni</family>
	 <family>AR PL ZenKai Uni</family>
         <family>AR PL New Sung</family>
	 <family>FZSongTi</family>
	 <family>FZMingTiB</family>
         <family>Kochi Gothic</family>
         <family>AR PL KaitiM GB</family>
         <family>AR PL KaitiM Big5</family>
         <family>Baekmuk Dotum</family>

      </prefer>
   </alias>
   <alias>
      <family>monospace</family>
      <prefer>
	 <family>Courier New</family>
	 <family>Courier</family>
         <family>Andale Mono</family>
         <family>Luxi Mono</family>
         <family>Nimbus Mono L</family>
	 <family>Bitstream Vera Sans Mono</family>
	 <family>NSimSun</family>
	 <family>PMingLiu</family>
         <family>WenQuanYi Bitmap Song</family>
	 <family>AR PL ShanHeiSun Uni</family>
	 <family>AR PL ZenKai Uni</family>
         <family>AR PL New Sung</family>
	 <family>FZSongTi</family>
	 <family>FZMingTiB</family>
         <family>Kochi Gothic</family>
         <family>AR PL KaitiM GB</family>
         <family>Baekmuk Dotum</family>
      </prefer>
   </alias>

</fontconfig>
