<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file for local customizations -->
<fontconfig>
<!-- lab126 -->
<!-- Additional font directory list -->
    <dir>/usr/java/lib/fonts</dir>

<!-- Combine the Caecilia font to use just one family name and assign
     the correct attribute values for each font. This follows the way all other
     fonts have in their metadata. Note that we also have a condensed version of
     the font that is handled separately
 -->

<!--
  Okay, nobody understands why the 'blank' element below fixes U+F819 (JTWO-4354)
  but it does, so maybe don't mess with it?
-->
    <match target="scan">
        <test name="fullname" compare="eq">
            <string>PMN Caecilia LT 65 Medium</string>
        </test>
        <edit name="family" mode="assign">
            <string>Caecilia Regular</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Medium</string>
        </edit>
        <blank>
           <int>63513</int>
        </blank>
    </match>
    <match target="scan">
        <test name="fullname" compare="eq">
            <string>PMN Caecilia LT 66 Medium Italic</string>
        </test>
        <edit name="family" mode="assign">
            <string>Caecilia Regular</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Italic</string>
        </edit>
        <edit name="slant" mode="assign">
            <const>italic</const>
        </edit>
    </match>
    <match target="scan">
        <test name="fullname" compare="eq">
            <string>PMN Caecilia LT 75 Bold</string>
        </test>
        <edit name="family" mode="assign">
            <string>Caecilia Regular</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Bold</string>
        </edit>
    </match>
    <match target="scan">
        <test name="fullname" compare="eq">
            <string>PMN Caecilia LT 76 Bold Italic</string>
        </test>
        <edit name="family" mode="assign">
            <string>Caecilia Regular</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Bold Italic</string>
        </edit>
        <edit name="slant" mode="assign">
            <const>italic</const>
        </edit>
    </match>
    <!-- now the condensed fonts -->
    <match target="scan">
        <test name="fullname" compare="eq">
            <string>PMN Caecilia LT 67 Kindle Cond Medium</string>
        </test>
        <edit name="family" mode="assign">
            <string>condensed</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Medium</string>
        </edit>
    </match>
    <match target="scan">
        <test name="fullname" compare="eq">
            <string>PMN Caecilia LT 68 Kindle Cond Medium Italic</string>
        </test>
        <edit name="family" mode="assign">
            <string>condensed</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Italic</string>
        </edit>
        <edit name="slant" mode="assign">
            <const>italic</const>
        </edit>
    </match>
    <match target="scan">
        <test name="fullname" compare="eq">
            <string>PMN Caecilia LT 77 Kindle Cond Bold</string>
        </test>
        <edit name="family" mode="assign">
            <string>condensed</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Bold</string>
        </edit>
    </match>
    <match target="scan">
        <test name="fullname" compare="eq">
            <string>PMN Caecilia LT 78 Kindle Cond Bold Italic</string>
        </test>
        <edit name="family" mode="assign">
            <string>condensed</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Bold Italic</string>
        </edit>
        <edit name="slant" mode="assign">
            <const>italic</const>
        </edit>
    </match>
<!-- Combine the Helvetica Neue fonts to use just one family name and assign
     the correct attribute values for each font. This follows the way all other
     fonts have in their metadata.
 -->
    <match target="scan">
        <test name="family" compare="eq">
            <string>Helvetica Neue LT 65 Kindle Medium</string>
        </test>
        <edit name="family" mode="assign">
            <string>Helvetica Neue LT</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Medium</string>
        </edit>
    </match>
    <match target="scan">
        <test name="family" compare="eq">
            <string>Helvetica Neue LT 66 Kindle Medium Italic</string>
        </test>
        <edit name="family" mode="assign">
            <string>Helvetica Neue LT</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Italic</string>
        </edit>
        <edit name="slant" mode="assign">
            <const>italic</const>
        </edit>
    </match>
    <match target="scan">
        <test name="family" compare="eq">
            <string>Helvetica Neue LT 75 Kindle Bold</string>
        </test>
        <edit name="family" mode="assign">
            <string>Helvetica Neue LT</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Bold</string>
        </edit>
    </match>
    <match target="scan">
        <test name="family" compare="eq">
            <string>Helvetica Neue LT 76 Kindle Bold Italic</string>
        </test>
        <edit name="family" mode="assign">
            <string>Helvetica Neue LT</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Bold Italic</string>
        </edit>
        <edit name="slant" mode="assign">
            <const>italic</const>
        </edit>
    </match>

<!-- Japanese fonts -->
    <match target="scan">
       <test name="family" compare="eq">
           <string>HeiseiMaruGoth_JIS0213_E bold</string>
       </test>
       <edit name="family" mode="assign">
           <string>HeiseiMaruGoth_JIS0213_E</string>
       </edit>
       <edit name="style" mode="assign">
           <string>Bold</string>
       </edit>
    </match>
    <match target="scan">
       <test name="family" compare="eq">
           <string>HeiseiMaruGoth_JIS0213_E light</string>
       </test>
       <edit name="family" mode="assign">
           <string>HeiseiMaruGoth_JIS0213_E</string>
       </edit>
       <edit name="style" mode="assign">
           <string>Regular</string>
       </edit>
    </match>


<!-- Korean fonts -->
    <match target="scan">
       <test name="family" compare="eq">
           <string>HangulGothicMTC_Medium_E bold</string>
       </test>
       <edit name="family" mode="assign">
           <string>HangulGothicMTC-Medium_E</string>
       </edit>
       <edit name="style" mode="assign">
           <string>Bold</string>
       </edit>
    </match>
    <match target="scan">
       <test name="family" compare="eq">
           <string>HangulGothicMTC_Medium_E light</string>
       </test>
       <edit name="family" mode="assign">
           <string>HangulGothicMTC-Medium_E</string>
       </edit>
       <edit name="style" mode="assign">
           <string>Regular</string>
       </edit>
    </match>


<!-- Fix Monospaced KindleBlackBoxC Bold and Bold-Italic fonts's weight -->
    <match target="scan">
        <test name="family" compare="eq">
            <string>KindleBlackboxC</string>
        </test>
        <test name="style" compare="eq">
            <string>Bold</string>
        </test>
        <edit name="weight" mode="assign">
            <const>bold</const>
        </edit>
    </match>
    <match target="scan">
        <test name="family" compare="eq">
            <string>KindleBlackboxC</string>
        </test>
        <test name="style" compare="eq">
            <string>BoldItalic</string>
        </test>
        <edit name="weight" mode="assign">
            <const>bold</const>
        </edit>
    </match>

    <!-- provide the alias 'monospaced' for 'monospace' -->
    <match target="pattern">
	    <test qual="any" name="family">
		    <string>monospaced</string>
	    </test>
	    <edit name="family" mode="assign">
		    <string>monospace</string>
	    </edit>
    </match>


<!-- Generic identification, map family->generic -->
    <alias>
%SERIF%
        <family>Caecilia Regular</family>
        <family>Kindle Symbol</family>
        <family>HeiseiMaruGoth_JIS0213_E</family>
        <family>HangulGothicMTC-Medium_E</family>
        <family>MHeiGB18030C-Medium_E</family>
        <family>MHeiC-Medium-Big5HKSCS_E</family>
        <family>Code2000</family>
        <default>
            <family>serif</family>
        </default>
    </alias>
    <alias>
%SANS%
        <family>Helvetica Neue LT</family>
        <family>Kindle Symbol</family>
        <family>HeiseiMaruGoth_JIS0213_E</family>
        <family>HangulGothicMTC-Medium_E</family>
        <family>MHeiGB18030C-Medium_E</family>
        <family>MHeiC-Medium-Big5HKSCS_E</family>
        <family>Code2000</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
%MONO%
        <family>KindleBlackboxC</family>
        <family>Kindle MonospaceSymbol</family>
        <family>HeiseiMaruGoth_JIS0213_E</family>
        <family>HangulGothicMTC-Medium_E</family>
        <family>MHeiGB18030C-Medium_E</family>
        <family>MHeiC-Medium-Big5HKSCS_E</family>
        <family>Code2000</family>
        <family>monospace</family>
        <default>
            <family>monospace</family>
        </default>
    </alias>

    <alias>
        <family>condensed</family>
        <family>Kindle Symbol</family>
        <family>HeiseiMaruGoth_JIS0213_E</family>
        <family>HangulGothicMTC-Medium_E</family>
        <family>MHeiGB18030C-Medium_E</family>
        <family>MHeiC-Medium-Big5HKSCS_E</family>
        <family>Code2000</family>
	<default>
	    <family>condensed</family>
	</default>
    </alias>

<!-- Generic aliases, map generic->family -->

    <alias>
	    <family>condensed</family>
	    <prefer>
                    <family>condensed</family>
                    <family>Kindle Symbol</family>
                    <family>HeiseiMaruGoth_JIS0213_E</family>
                    <family>HangulGothicMTC-Medium_E</family>
                    <family>MHeiGB18030C-Medium_E</family>
                    <family>MHeiC-Medium-Big5HKSCS_E</family>
                    <family>Code2000</family>
	    </prefer>
    </alias>

    <alias>
        <family>serif</family>
        <prefer>
%SERIF%
            <family>Caecilia Regular</family>
            <family>Kindle Symbol</family>
            <family>HeiseiMaruGoth_JIS0213_E</family>
            <family>HangulGothicMTC-Medium_E</family>
            <family>MHeiGB18030C-Medium_E</family>
            <family>MHeiC-Medium-Big5HKSCS_E</family>
            <family>Code2000</family>
        </prefer>
    </alias>

    <!-- for various reasons, Sun uses the pango properties file
         to force (Java logical font) serif to use the name
         'Caecilia Regular' rather than using fontconfig's 'serif'.
         So map the fallbacks onto that font alias too.
    -->
    <alias>
        <family>Caecilia Regular</family>
        <prefer>
%SERIF%
            <family>Caecilia Regular</family>
            <family>Kindle Symbol</family>
            <family>HeiseiMaruGoth_JIS0213_E</family>
            <family>HangulGothicMTC-Medium_E</family>
            <family>MHeiGB18030C-Medium_E</family>
            <family>MHeiC-Medium-Big5HKSCS_E</family>
            <family>Code2000</family>
        </prefer>
    </alias>


    <alias>
        <family>sans-serif</family>
        <prefer>
%SANS%
            <family>Helvetica Neue LT</family>
            <family>Kindle Symbol</family>
            <family>HeiseiMaruGoth_JIS0213_E</family>
            <family>HangulGothicMTC-Medium_E</family>
            <family>MHeiGB18030C-Medium_E</family>
            <family>MHeiC-Medium-Big5HKSCS_E</family>
            <family>Code2000</family>
        </prefer>
    </alias>
    <alias>
        <family>monospace</family>
        <prefer>
%MONO%
            <family>KindleBlackboxC</family>
            <family>Kindle MonospaceSymbol</family>
            <family>HeiseiMaruGoth_JIS0213_E</family>
            <family>HangulGothicMTC-Medium_E</family>
            <family>MHeiGB18030C-Medium_E</family>
            <family>MHeiC-Medium-Big5HKSCS_E</family>
            <family>Code2000</family>
        </prefer>
    </alias>

    <!-- add korean specific font preference -->
    <match>
	    <test name="lang">
		    <string>ko</string>
	    </test>
	    <test name="family">
		    <string>sans-serif</string>
	    </test>
	    <edit name="family" mode="prepend">
		    <string>HangulGothicMTC-Medium_E</string>
	    </edit>
    </match>
    <match>
	    <test name="lang">
		    <string>ko</string>
	    </test>
	    <test name="family">
		    <string>serif</string>
	    </test>
	    <edit name="family" mode="prepend">
		    <string>HangulGothicMTC-Medium_E</string>
	    </edit>
    </match>

    <!-- add chinese (simplified) specific font preference -->
    <match>
	    <test name="lang">
		    <string>zh</string>
		    <string>zh-cn</string>
		    <string>zh-hans</string>
	    </test>
	    <test name="family">
		    <string>sans-serif</string>
	    </test>
	    <edit name="family" mode="prepend">
		    <string>MHeiGB18030C-Medium_E</string>
	    </edit>
    </match>
    <match>
	    <test name="lang">
		    <string>zh</string>
		    <string>zh-cn</string>
		    <string>zh-hans</string>
	    </test>
	    <test name="family">
		    <string>serif</string>
	    </test>
	    <edit name="family" mode="prepend">
		    <string>MHeiGB18030C-Medium_E</string>
	    </edit>
    </match>
<!-- /lab126 -->

<!--
  Enable sub-pixel rendering
	<match target="font">
		<test qual="all" name="rgba">
			<const>unknown</const>
		</test>
		<edit name="rgba" mode="assign"><const>rgb</const></edit>
	</match>
-->
<!--
  Reject bitmap fonts
 -->

 <selectfont>
  <rejectfont>
   <pattern>
     <patelt name="scalable"><bool>false</bool></patelt>
   </pattern>
  </rejectfont>
 </selectfont>

<!--
  Accept bitmap fonts.  This overrides any rejectfont which matches

 <selectfont>
  <acceptfont>
   <pattern>
     <patelt name="scalable"><bool>false</bool></patelt>
   </pattern>
  </acceptfont>
 </selectfont>
 -->
</fontconfig>
