Archive for October 2008

Improving font rendering under Ubuntu

Ubuntu ships FreeType with the bytecode interpreter enabled. This works very well for common typefaces such as Vera, DejaVu, Verdana and Georgia at small sizes but somehow doesn’t for other typefaces and sizes.

After some tinkering, I came up with a configuration that works for me:

  1. Open the Terminal and type sudo dpkg-reconfigure fontconfig-config
  2. Choose Autohinter, Automatic for subpixel rendering, and No for bitmapped fonts.
  3. Under System ? Preferences ? Appearance ? Fonts ? Details, choose Subpixel and Slight.
  4. Restart OpenOffice (including the Quickstarter) and Firefox. These two don’t reflect changes automatically.

We’re making two choices here:

  1. Native bytecode interpreter vs the autohinter. I’m not completely sold on one over the other.
  2. Full vs slight subpixel rendering. Full looks fantastic at small sizes (8-9pt) but terrible when large. Slight is less well defined at small sizes, but acceptably well shaped for larger sizes.

Further reading: Comprehensive Ubuntu Font Configuration Guide (written for Gutsy but also applicable to Intrepid).

Update: Disregard the above. The blurriness at small size gets unbearable after a while. Go back to native interpreter, full subpixel hinting, and setup custom workarounds in your ~/.fonts.conf file. Here’s mine:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <match target="font">
        <test qual="any" name="family" compare="eq">
            <!-- Twitter uses Lucida Grande. The site looks terrible without
                 hintslight enabled. -->
            <string>Lucida Grande</string>
        </test>
        <edit name="autohint" mode="assign">
            <bool>true</bool>
        </edit>
        <edit name="hintstyle" mode="assign">
            <const>hintslight</const>
        </edit>
    </match>
</fontconfig>

What godly images can't, maybe an epidemic scare can?

Image from phone camera.