Fontconfig and Chromium

Thanks to this explanation from Evan Martin, I’ve finally figured out how to get fonts looking right in Chromium on Linux. The crux of the problem is that there are two font configuration systems. UI widgets read settings from one, the panel at System → Preferences → Appearance, while the browser area reads from fontconfig.

I prefer the appearance of full sub-pixel hinting on Ubuntu, but this setting, selected from the preferences panel, wasn’t being propagated to fontconfig, so web pages continued to have blurry text. The fix? Here is my new ~/.fonts.conf:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
    <match target="font">
        <edit mode="assign" name="hintstyle">
            <const>hintfull</const>
        </edit>
        <edit mode="assign" name="rgba">
            <const>rgb</const>
        </edit>
    </match>
</fontconfig>

Evan proposes a test for what hintstyle fontconfig is using:

$ fc-match -v Arial | grep hintstyle
        hintstyle: 3(i)(w)

The hintstyle of “3” indicates full hinting. Ubuntu’s default, slight hinting, would be “1”.

  • Avatar

    antrix — May 13, 2010 3:42:52 PM — #

    Interesting. If I am not mistaken, KDE/Kubuntu’s font configuration tool generates ~/.fonts.conf

    Nevertheless, I am still unhappy with the font situation after upgrade to Lucid :(

Leave a Reply

You can respond with a photo by tagging it on Flickr with