<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>
<!-- Additional font directory list -->
    <dir>/system/fonts</dir>

<!-- Set Code2000's and Droid Sans Fallback's lang property to the empty string. 
     Fontconfig matching is done in the following priority order - foundry, charset, 
     family, lang, spacing, pixelsize, style, slant, weight, antialias, rasterizer
     and outline. Thus setting Code2000's and Droid Sans Fallback's lang to the 
     empty string means that it will never match on lang, which achieve the desire 
     behavior that both fonts are used only when it is the only font that match a 
     given charset.
-->
    <match target="scan">
        <test name="family" compare="eq">
        <!-- 3p doesn't contain Code2000 -->
            <string>Code2000</string>
        </test>
        <edit name="lang" mode="assign">
            <langset>
                <string></string>
            </langset>
        </edit>
    </match>

    <match target="scan">
        <test name="family" compare="eq">
            <string>Droid Sans Fallback</string>
        </test>
        <edit name="lang" mode="assign">
            <langset>
                <string></string>
            </langset>
        </edit>
    </match>

<!-- Set the langsets of Naskh compact and elegant variants to the same
     langset, so that the deciding factor of which font is a better
     match is based on the variant that an application specifies, if any.
     Otherwise, if the langsets are different, lang preference may
     become the deciding factor instead because lang preference has
     a higher precedence.
     Since the elegant variant's langset is a subset of the compact
     variant's, just use the elegant variant's langset as the common
     langset and set the compact variant's langset to it.
-->
    <match target="scan">
        <test name="family" compare="eq">
            <string>Droid Naskh Shift Alt</string>
        </test>
        <edit name="lang" mode="assign">
            <langset>
                <string>ar</string><string>az-ir</string><string>fa</string>
                <string>ku-ir</string><string>ps-af</string><string>ps-pk</string>
                <string>ug</string><string>ur</string><string>ku-iq</string>
                <string>ota</string><string>pa-pk</string><string>sd</string>
                <string>lah</string>
            </langset>
        </edit>
    </match>

<!-- Change DroidSans.ttf and DroidSans-Bold.ttf to have the family name
     Droid Sans, instead of Roboto, which conflicts with the various
     Roboto-*.ttf fonts.
-->
    <match target="scan">
        <test name="file" compare="eq">
            <string>/system/fonts/DroidSans.ttf</string>
        </test>
        <edit name="family" mode="assign">
            <string>Droid Sans</string>
        </edit>
        <edit name="fullname" mode="assign">
            <string>Droid Sans Regular</string>
        </edit>
    </match>
    <match target="scan">
        <test name="file" compare="eq">
            <string>/system/fonts/DroidSans-Bold.ttf</string>
        </test>
        <edit name="family" mode="assign">
            <string>Droid Sans</string>
        </edit>
        <edit name="fullname" mode="assign">
            <string>Droid Sans Bold</string>
        </edit>
    </match>

<!-- Roboto-Thin font's langset contains ro (Romanian), but Roboto does
     not. So when requesting a sans-serif font and lang is ro, Roboto-Thin
     is returned, but that's not desired. Roboto should be returned.
     So add 'ro' to Roboto's langset, so we don't need to worry about
     other fonts being chosen for 'ro' as the default sans-serif font.
-->
    <match target="scan">
        <test name="family" compare="eq">
            <string>Roboto</string>
        </test>
        <edit name="lang" mode="assign">
            <plus>
                <name>lang</name>
                <langset>
                    <string>ro</string>
                </langset>
            </plus>
        </edit>
    </match>

<!-- Android JB setup of Roboto-Light and Roboto-Thin fonts is
     unconventional, probably to workaround Android's limited font
     style API (only support normal, bold, italic, and bold italic;
     no support for light, regular, etc). Each of these fonts is
     behaving like it is its own family, instead of a style of one
     single family. Thus, each "family" then relies on the system to
     fake bold.
 -->
    <match target="scan">
        <test name="fullname" compare="eq">
            <string>Roboto Light</string>
        </test>
        <edit name="family" mode="assign">
            <string>Roboto Light</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Light</string>
        </edit>
        <edit name="weight" mode="assign">
            <const>light</const>
        </edit>
    </match>
    <match target="scan">
        <test name="fullname" compare="eq">
            <string>Roboto Light Italic</string>
        </test>
        <edit name="family" mode="assign">
            <string>Roboto Light</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Light Italic</string>
        </edit>
        <edit name="weight" mode="assign">
            <const>light</const>
        </edit>
    </match>
    <match target="scan">
        <test name="fullname" compare="eq">
            <string>Roboto Thin</string>
        </test>
        <edit name="family" mode="assign">
            <string>Roboto Thin</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Thin</string>
        </edit>
        <edit name="weight" mode="assign">
            <const>thin</const>
        </edit>
    </match>
    <match target="scan">
        <test name="fullname" compare="eq">
            <string>Roboto Thin Italic</string>
        </test>
        <edit name="family" mode="assign">
            <string>Roboto Thin</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Thin Italic</string>
        </edit>
        <edit name="weight" mode="assign">
            <const>thin</const>
        </edit>
    </match>

<!-- Combine Baskerville fonts -->
    <match target="scan">
    <test name="family" compare="eq">
        <string>Baskerville Regular</string>
    </test>
    <edit name="family" mode="assign">
        <string>Baskerville</string>
    </edit>
    <edit name="style" mode="assign">
        <string>Medium</string>
    </edit>
    </match>
    <match target="scan">
        <test name="family" compare="eq">
            <string>Baskerville Italic</string>
        </test>
        <edit name="family" mode="assign">
            <string>Baskerville</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>Baskerville Bold</string>
        </test>
        <edit name="family" mode="assign">
            <string>Baskerville</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Bold</string>
        </edit>
    </match>
    <match target="scan">
        <test name="family" compare="eq">
            <string>Baskerville Bold Italic</string>
        </test>
        <edit name="family" mode="assign">
            <string>Baskerville</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Bold Italic</string>
        </edit>
        <edit name="slant" mode="assign">
            <const>italic</const>
        </edit>
    </match>

<!-- Combine Palatino fonts -->
    <match target="scan">
        <test name="family" compare="eq">
            <string>Palatino Regular</string>
        </test>
        <edit name="family" mode="assign">
            <string>Palatino</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Medium</string>
        </edit>
    </match>
    <match target="scan">
        <test name="family" compare="eq">
            <string>Palatino Italic</string>
        </test>
        <edit name="family" mode="assign">
            <string>Palatino</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>Palatino Bold</string>
        </test>
        <edit name="family" mode="assign">
            <string>Palatino</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Bold</string>
        </edit>
    </match>
    <match target="scan">
        <test name="family" compare="eq">
            <string>Palatino Bold Italic</string>
        </test>
        <edit name="family" mode="assign">
            <string>Palatino</string>
        </edit>
        <edit name="style" mode="assign">
            <string>Bold Italic</string>
        </edit>
        <edit name="slant" mode="assign">
            <const>italic</const>
        </edit>
    </match>

<!-- Combine TsukushiMincho fonts -->
<!-- 3p doesn't support TsukushiMincho so commenting out below scan and will be replacing TsukushiMincho with TBMincho -->
<!--
    <match target="scan">
       <test name="family" compare="eq">
           <string>AMZTsukuMincho B</string>
       </test>
       <edit name="family" mode="assign">
           <string>TsukushiMincho</string>
       </edit>
       <edit name="style" mode="assign">
           <string>Bold</string>
       </edit>
    </match>
    <match target="scan">
       <test name="family" compare="eq">
           <string>AMZTsukuMincho M</string>
       </test>
       <edit name="family" mode="assign">
           <string>TsukushiMincho</string>
       </edit>
       <edit name="style" mode="assign">
           <string>Medium</string>
       </edit>
    </match>
-->
<!-- Combine TBGothic fonts -->
    <match target="scan">
       <test name="family" compare="eq">
           <string>TBGothic</string>
       </test>
       <test name="style" mode="assign">
           <string>Medium</string>
       </test>
       <edit name="weight" mode="assign">
           <const>medium</const>
       </edit>
    </match>

<!-- Combine HYGothic fonts -->
    <match target="scan">
       <test name="family" compare="eq">
           <string>HYGothic</string>
       </test>
       <test name="style" compare="eq">
           <string>Bold</string>
       </test>
       <edit name="weight" mode="assign">
           <const>bold</const>
       </edit>
    </match>

<!-- Combine HYMyeongJo fonts -->
<!-- no correction needed -->

<!-- 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>
    <match target="pattern">
        <test qual="any" name="family">
            <string>monospace sans</string>
        </test>
        <edit name="family" mode="assign">
            <string>monospace</string>
        </edit>
    </match>

<!-- Generic identification, map family->generic -->
    <alias>
        <family>Droid Serif</family>
        <default>
            <family>serif</family>
        </default>
    </alias>
    <alias>
        <family>Bookerly</family>
        <default>
            <family>serif</family>
        </default>
    </alias>
    <alias>
        <family>Palatino</family>
        <default>
            <family>serif</family>
        </default>
    </alias>
    <alias>
        <family>Baskerville</family>
        <default>
            <family>serif</family>
        </default>
    </alias>
    <alias>
        <family>Georgia</family>
        <default>
            <family>serif</family>
        </default>
    </alias>

    <alias>
        <family>PMN Caecilia LT</family>
        <default>
            <family>serif</family>
        </default>
    </alias>
    <alias>
        <family>TBMincho</family>
        <default>
            <family>serif</family>
        </default>
    </alias>
    <alias>
        <family>HYMyeongJo</family>
        <default>
            <family>serif</family>
        </default>
    </alias>
    <alias>
        <family>STBShusong</family>
        <default>
            <family>serif</family>
        </default>
    </alias>
    <alias>
        <family>STKaiti</family>
        <default>
            <family>serif</family>
        </default>
    </alias>
    <alias>
        <family>Code2000</family>
        <default>
            <family>serif</family>
        </default>
    </alias>

    <alias>
        <family>Roboto</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Roboto Light</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Roboto Thin</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Roboto Condensed</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Droid Sans</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Lucida Sans</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Helvetica Neue WGL</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <!-- This is the compact-variant Arabic-script font,
             and is the default Arabic-script font. -->
        <family>Droid Naskh Shift Alt</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <!-- This is the elegant-variant Arabic-script font.
             Android is using this one when rendering Arabic
             web pages in WebView. FWK-1101 tracks making
             this variant available. -->
        <family>Droid Arabic Naskh</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Droid Sans Hebrew</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Droid Sans Thai</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Droid Sans Armenian</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Droid Sans Georgian</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Droid Sans Ethiopic</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Droid Sans Devanagari</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Droid Sans Tamil</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>AnjaliNewLipi</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Lohit Bengali</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Lohit Kannada</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Lohit Telugu</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Trebuchet</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Verdana</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>TBGothic</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>HYGothic</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>STZhongyuan</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Android Emoji</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>Kindle Symbol</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>

    <alias>
        <family>Droid Sans Mono</family>
        <default>
            <family>monospace</family>
        </default>
    </alias>
    <alias>
        <family>Source Code Pro</family>
        <default>
            <family>monospace serif</family>
        </default>
    </alias>

<!--  If the font still has no generic name, add sans-serif -->
    <match target="pattern">
        <test qual="all" name="family" compare="not_eq">
            <string>sans-serif</string>
        </test>
        <test qual="all" name="family" compare="not_eq">
            <string>serif</string>
        </test>
        <test qual="all" name="family" compare="not_eq">
            <string>monospace</string>
        </test>
        <test qual="all" name="family" compare="not_eq">
            <string>casual</string>
        </test>
        <test qual="all" name="family" compare="not_eq">
            <string>cursive</string>
        </test>
        <test qual="all" name="family" compare="not_eq">
            <string>monospace serif</string>
        </test>
        <test qual="all" name="family" compare="not_eq">
            <string>small capital</string>
        </test>
        <edit name="family" mode="append_last">
            <string>sans-serif</string>
        </edit>
    </match>

<!-- Generic aliases, map generic->family -->
    <alias>
        <family>serif</family>
        <prefer>
            <family>Bookerly</family>
            <family>Droid Serif</family>
            <family>PMN Caecilia LT</family>
            <family>Baskerville</family>
            <family>Palatino</family>
            <family>Droid Naskh Shift Alt</family>
            <family>Droid Sans Ethiopic</family>
            <family>Droid Sans Hebrew</family>
            <family>Noto Sans Thai UI</family>
            <family>Droid Sans Thai</family>
            <family>Droid Sans Armenian</family>
            <family>Droid Sans Georgian</family>
            <family>Noto Sans Devanagari UI</family>
            <family>Droid Sans Devanagari</family>
            <family>Noto Sans Tamil UI</family>
            <family>Droid Sans Tamil</family>
            <family>Noto Sans Malayalam UI</family>
            <family>Noto Sans Bengali UI</family>
            <family>Noto Sans Telugu UI</family>
            <family>Noto Sans Kannada UI</family>
            <family>Noto Sans UI Khmer</family>
            <family>Noto Sans Lao UI</family>
            <family>Padauk Book</family>
            <family>AnjaliNewLipi</family>
            <family>Lohit Bengali</family>
            <family>Lohit Kannada</family>
            <family>TBMincho</family>
            <family>HYMyeongJo</family>
            <family>STBShusong</family>
            <family>Noto Sans TC</family>
            <family>MT Chinese Surrogates</family>
            <family>Kindle Symbol</family>
            <family>Lohit Telugu</family>
            <family>Android Emoji</family>
            <family>Noto Sans Symbols</family>
            <family>Noto Color Emoji</family>
            <family>Code2000</family>
        </prefer>
    </alias>

    <alias>
        <family>sans-serif</family>
        <prefer>
            <family>Roboto</family>
            <family>Helvetica Neue WGL</family>
            <family>Droid Naskh Shift Alt</family>
            <family>Droid Sans Ethiopic</family>
            <family>Droid Sans Hebrew</family>
            <family>Noto Sans Thai UI</family>
            <family>Droid Sans Thai</family>
            <family>Droid Sans Armenian</family>
            <family>Droid Sans Georgian</family>
            <family>Noto Sans Devanagari UI</family>
            <family>Droid Sans Devanagari</family>
            <family>Noto Sans Tamil UI</family>
            <family>Droid Sans Tamil</family>
            <family>Noto Sans Malayalam UI</family>
            <family>Noto Sans Bengali UI</family>
            <family>Noto Sans Telugu UI</family>
            <family>Noto Sans Kannada UI</family>
            <family>Noto Sans UI Khmer</family>
            <family>Noto Sans Lao UI</family>
            <family>Padauk Book</family>
            <family>AnjaliNewLipi</family>
            <family>Lohit Bengali</family>
            <family>Lohit Kannada</family>
            <family>TBGothic</family>
            <family>HYGothic</family>
            <family>Noto Sans S Chinese</family>
            <family>Noto Sans TC</family>
            <family>MT Chinese Surrogates</family>
            <family>Kindle Symbol</family>
            <family>Lohit Telugu</family>
            <family>Android Emoji</family>
            <family>Noto Sans Symbols</family>
            <family>Noto Color Emoji</family>
            <family>Code2000</family>
        </prefer>
    </alias>

    <alias>
        <family>monospace</family>
        <prefer>
            <family>Droid Sans Mono</family>
            <family>Droid Naskh Shift Alt</family>
            <family>Droid Sans Ethiopic</family>
            <family>Droid Sans Hebrew</family>
            <family>Noto Sans Thai UI</family>
            <family>Droid Sans Thai</family>
            <family>Droid Sans Armenian</family>
            <family>Droid Sans Georgian</family>
            <family>Noto Sans Devanagari UI</family>
            <family>Droid Sans Devanagari</family>
            <family>Noto Sans Tamil UI</family>
            <family>Droid Sans Tamil</family>
            <family>Noto Sans Malayalam UI</family>
            <family>Noto Sans Bengali UI</family>
            <family>Noto Sans Telugu UI</family>
            <family>Noto Sans Kannada UI</family>
            <family>Noto Sans UI Khmer</family>
            <family>Noto Sans Lao UI</family>
            <family>Padauk Book</family>
            <family>AnjaliNewLipi</family>
            <family>Lohit Bengali</family>
            <family>Lohit Kannada</family>
            <family>TBMincho</family>
            <family>HYMyeongJo</family>
            <family>STBShusong</family>
            <family>Noto Sans TC</family>
            <family>MT Chinese Surrogates</family>
            <family>Kindle Symbol</family>
            <family>Lohit Telugu</family>
            <family>Android Emoji</family>
            <family>Noto Sans Symbols</family>
            <family>Noto Color Emoji</family>
            <family>Code2000</family>
        </prefer>
    </alias>

    <alias>
        <family>casual</family>
        <prefer>
            <family>MotoyaLMaru</family>
            <family>Roboto</family>
            <family>Helvetica Neue Regular</family>
            <family>Helvetica Neue Medium</family>
            <family>Droid Naskh Shift Alt</family>
            <family>Droid Sans Ethiopic</family>
            <family>Droid Sans Hebrew</family>
            <family>Noto Sans Thai UI</family>
            <family>Droid Sans Thai</family>
            <family>Droid Sans Armenian</family>
            <family>Droid Sans Georgian</family>
            <family>Noto Sans Devanagari UI</family>
            <family>Droid Sans Devanagari</family>
            <family>Noto Sans Tamil UI</family>
            <family>Droid Sans Tamil</family>
            <family>Noto Sans Malayalam UI</family>
            <family>Noto Sans Bengali UI</family>
            <family>Noto Sans Telugu UI</family>
            <family>Noto Sans Kannada UI</family>
            <family>Noto Sans UI Khmer</family>
            <family>Noto Sans Lao UI</family>
            <family>Padauk Book</family>
            <family>AnjaliNewLipi</family>
            <family>Lohit Bengali</family>
            <family>Lohit Kannada</family>
            <family>TBGothic</family>
            <family>HYGothic</family>
            <family>Noto Sans S Chinese</family>
            <family>Noto Sans TC</family>
            <family>MT Chinese Surrogates</family>
            <family>Kindle Symbol</family>
            <family>Lohit Telugu</family>
            <family>Android Emoji</family>
            <family>Noto Sans Symbols</family>
            <family>Noto Color Emoji</family>
            <family>Code2000</family>
        </prefer>
    </alias>
    <alias>
        <family>cursive</family>
        <prefer>
            <family>Dancing-script</family>
            <family>Droid Serif</family>
            <family>Caecilia Regular</family>
            <family>Droid Naskh Shift Alt</family>
            <family>Droid Sans Ethiopic</family>
            <family>Droid Sans Hebrew</family>
            <family>Noto Sans Thai UI</family>
            <family>Droid Sans Thai</family>
            <family>Droid Sans Armenian</family>
            <family>Droid Sans Georgian</family>
            <family>Noto Sans Devanagari UI</family>
            <family>Droid Sans Devanagari</family>
            <family>Noto Sans Tamil UI</family>
            <family>Droid Sans Tamil</family>
            <family>Noto Sans Malayalam UI</family>
            <family>Noto Sans Bengali UI</family>
            <family>Noto Sans Telugu UI</family>
            <family>Noto Sans Kannada UI</family>
            <family>Noto Sans UI Khmer</family>
            <family>Noto Sans Lao UI</family>
            <family>Padauk Book</family>
            <family>AnjaliNewLipi</family>
            <family>Lohit Bengali</family>
            <family>Lohit Kannada</family>
            <family>TBMincho</family>
            <family>HYMyeongJo</family>
            <family>STBShusong</family>
            <family>Noto Sans TC</family>
            <family>MT Chinese Surrogates</family>
            <family>Kindle Symbol</family>
            <family>Lohit Telugu</family>
            <family>Android Emoji</family>
            <family>Noto Sans Symbols</family>
            <family>Noto Color Emoji</family>
            <family>Code2000</family>
        </prefer>
    </alias>
    <alias>
        <family>monospace serif</family>
        <prefer>
            <family>Source Code Pro</family>
            <family>Droid Sans Mono</family>
            <family>Droid Naskh Shift Alt</family>
            <family>Droid Sans Ethiopic</family>
            <family>Droid Sans Hebrew</family>
            <family>Noto Sans Thai UI</family>
            <family>Droid Sans Thai</family>
            <family>Droid Sans Armenian</family>
            <family>Droid Sans Georgian</family>
            <family>Noto Sans Devanagari UI</family>
            <family>Droid Sans Devanagari</family>
            <family>Noto Sans Tamil UI</family>
            <family>Droid Sans Tamil</family>
            <family>Noto Sans Malayalam UI</family>
            <family>Noto Sans Bengali UI</family>
            <family>Noto Sans Telugu UI</family>
            <family>Noto Sans Kannada UI</family>
            <family>Noto Sans UI Khmer</family>
            <family>Noto Sans Lao UI</family>
            <family>Padauk Book</family>
            <family>AnjaliNewLipi</family>
            <family>Lohit Bengali</family>
            <family>Lohit Kannada</family>
            <family>TBMincho</family>
            <family>HYMyeongJo</family>
            <family>STBShusong</family>
            <family>Noto Sans TC</family>
            <family>MT Chinese Surrogates</family>
            <family>Kindle Symbol</family>
            <family>Lohit Telugu</family>
            <family>Android Emoji</family>
            <family>Noto Sans Symbols</family>
            <family>Noto Color Emoji</family>
            <family>Code2000</family>
        </prefer>
    </alias>
    <alias>
        <family>small capital</family>
        <prefer>
            <family>Bookerly</family>
            <family>Droid Serif</family>
            <family>Caecilia Regular</family>
            <family>Droid Naskh Shift Alt</family>
            <family>Droid Sans Ethiopic</family>
            <family>Droid Sans Hebrew</family>
            <family>Noto Sans Thai UI</family>
            <family>Droid Sans Thai</family>
            <family>Droid Sans Armenian</family>
            <family>Droid Sans Georgian</family>
            <family>Noto Sans Devanagari UI</family>
            <family>Droid Sans Devanagari</family>
            <family>Noto Sans Tamil UI</family>
            <family>Droid Sans Tamil</family>
            <family>Noto Sans Malayalam UI</family>
            <family>Noto Sans Bengali UI</family>
            <family>Noto Sans Telugu UI</family>
            <family>Noto Sans Kannada UI</family>
            <family>Noto Sans UI Khmer</family>
            <family>Noto Sans Lao UI</family>
            <family>Padauk Book</family>
            <family>AnjaliNewLipi</family>
            <family>Lohit Bengali</family>
            <family>Lohit Kannada</family>
            <family>TBMincho</family>
            <family>HYMyeongJo</family>
            <family>STBShusong</family>
            <family>Noto Sans TC</family>
            <family>MT Chinese Surrogates</family>
            <family>Kindle Symbol</family>
            <family>Lohit Telugu</family>
            <family>Android Emoji</family>
            <family>Noto Sans Symbols</family>
            <family>Noto Color Emoji</family>
            <family>Code2000</family>
        </prefer>
    </alias>

    <!-- Add Simplified Chinese lang tag mappings -->
    <match>
        <test name="lang">
            <string>zh</string>
        </test>
        <edit name="lang">
            <string>zh-CN</string>
        </edit>
    </match>
    <match>
        <test name="lang">
            <string>zh-Hans</string>
        </test>
        <edit name="lang">
            <string>zh-CN</string>
        </edit>
    </match>
    <match>
        <test name="lang">
            <string>zh-Hans-CN</string>
        </test>
        <edit name="lang">
            <string>zh-CN</string>
        </edit>
    </match>

    <!-- Add Traditional Chinese lang tag mappings -->
    <match>
        <test name="lang">
            <string>zh-Hant</string>
        </test>
        <edit name="lang">
            <string>zh-TW</string>
        </edit>
    </match>
    <match>
        <test name="lang">
            <string>zh-Hant-TW</string>
        </test>
        <edit name="lang">
            <string>zh-TW</string>
        </edit>
    </match>
    <match>
        <test name="lang">
            <string>zh-Hant-HK</string>
        </test>
        <edit name="lang">
            <string>zh-HK</string>
        </edit>
    </match>

<!-- Incorporate JB's notion of font variant. The default variant
     is 'compact' and we don't need to do anything special for that.
     If the variant is 'elegant', apply font specific rules here.
-->
    <!-- Prepend the elegant variant before the compact variant of the
         Arabic-script font if elegant variant is specified. The binding
         should be 'weak' so that if the application requests the compact
         variant by name ('strong' binding), the compact variant would
         still be better match. -->
    <match>
        <test name="variant">
            <string>elegant</string>
        </test>
        <test name="family">
            <string>Droid Naskh Shift Alt</string>
        </test>
        <edit name="family" mode="prepend" binding="weak">
            <string>Droid Arabic Naskh</string>
        </edit>
    </match>

    <!-- Prepend the elegant variant before the compact variant for
         "non UI" Noto fonts based on settings in fallback_font.xml. Noto UI
         fonts shoud have variant="compact". -->
    <match>
        <test name="variant">
            <string>elegant</string>
        </test>
        <test name="family">
            <string>Noto Sans Thai UI</string>
        </test>
        <edit name="family" mode="prepend" binding="weak">
            <string>Noto Sans Thai</string>
        </edit>
    </match>

    <match>
        <test name="variant">
            <string>elegant</string>
        </test>
        <test name="family">
            <string>Noto Sans Devanagari UI</string>
        </test>
        <edit name="family" mode="prepend" binding="weak">
            <string>Noto Sans Devanagari</string>
        </edit>
    </match>

    <match>
        <test name="variant">
            <string>elegant</string>
        </test>
        <test name="family">
            <string>Noto Sans Tamil UI</string>
        </test>
        <edit name="family" mode="prepend" binding="weak">
            <string>Noto Sans Tamil</string>
        </edit>
    </match>

    <match>
        <test name="variant">
            <string>elegant</string>
        </test>
        <test name="family">
            <string>Noto Sans Malayalam UI</string>
        </test>
        <edit name="family" mode="prepend" binding="weak">
            <string>Noto Sans Malayalam</string>
        </edit>
    </match>

    <match>
        <test name="variant">
            <string>elegant</string>
        </test>
        <test name="family">
            <string>Noto Sans Bengali UI</string>
        </test>
        <edit name="family" mode="prepend" binding="weak">
            <string>Noto Sans Bengali</string>
        </edit>
    </match>

    <match>
        <test name="variant">
            <string>elegant</string>
        </test>
        <test name="family">
            <string>Noto Sans Telugu UI</string>
        </test>
        <edit name="family" mode="prepend" binding="weak">
            <string>Noto Sans Telugu</string>
        </edit>
    </match>

    <match>
        <test name="variant">
            <string>elegant</string>
        </test>
        <test name="family">
            <string>Noto Sans Kannada UI</string>
        </test>
        <edit name="family" mode="prepend" binding="weak">
            <string>Noto Sans Kannada</string>
        </edit>
    </match>

    <match>
        <test name="variant">
            <string>elegant</string>
        </test>
        <test name="family">
            <string>Noto Sans UI Khmer</string>
        </test>
        <edit name="family" mode="prepend" binding="weak">
            <string>Noto Sans Khmer</string>
        </edit>
    </match>

    <match>
        <test name="variant">
            <string>elegant</string>
        </test>
        <test name="family">
            <string>Noto Sans Lao UI</string>
        </test>
        <edit name="family" mode="prepend" binding="weak">
            <string>Noto Sans Lao</string>
        </edit>
    </match>

<!--
  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>
