Alias Arial to another font.

Well, I have written about this before: http://truongan.name.vn/?p=706

But the file 30-metric-aliases.conf is system configuration and could be overwrite when we upgrade fontconfig. It turned out there is another much easier way to do this. The /etc/fonts/local.conf is meant to contain user settings, and Arial can be replaced with match edit. My whole local.conf file is:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Font directory list -->

    <dir>/usr/share/fonts</dir>
    <dir>/media/data/fonts</dir>    
    <dir>~/.fonts</dir>

<!--   -->

    <!-- Globally use embedded bitmaps in fonts like Calibri? -->
    <match target="font" >
        <edit name="embeddedbitmap" mode="assign">
            <bool>false</bool>
        </edit>
    </match>

    <match target="pattern" >
        <edit name="prefer_outline" mode="assign">
            <bool>true</bool>
        </edit>
    </match>

    <match target="font">
        <edit name="antialias" mode="assign">
            <bool>true</bool>
           </edit>
    </match>


    <!-- Make (some) monospace/coding TTF fonts render as bitmaps? -->
    <!-- courier new, andale mono, monaco, etc. -->
    <match target="pattern" >
        <edit name="bitmap_monospace" mode="assign">
            <bool>false</bool>
        </edit>
    </match>

    <!-- Force autohint always -->
    <!-- Useful for debugging and for free software purists -->
    <match target="font">
        <edit name="force_autohint" mode="assign">
            <bool>false</bool>
        </edit>
    </match>

<!-- -->

    <match target="font">
        
        <edit name="hinting" mode="assign">
                    <bool>true</bool>
            </edit>
        <match target="font">
    <edit name="autohint" mode="assign">
      <bool>true</bool>
    </edit>
  </match>
        <edit name="hintstyle" mode="assign">
              <const>hintslight</const>
        </edit>
    </match>
      <match target="font">
    <edit name="rgba" mode="assign">
      <const>rgb</const>
    </edit>
  </match>
    <match target="font">
        <test name="weight" compare="more">
            <const>medium</const>
        </test>
        <edit name="autohint" mode="assign">
            <bool>false</bool>
        </edit>
    </match>


    <match target="pattern">
        <test qual="any" name="family"><string>Arial</string></test>
        <edit name="family" mode="assign" binding="same"><string>Droid Sans</string></edit>
        </match>
</fontconfig>