Thursday, October 23, 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:
- Open the Terminal and type sudo dpkg-reconfigure fontconfig-config
- Choose Autohinter, Automatic for subpixel rendering, and No for bitmapped fonts.
- Under System ? Preferences ? Appearance ? Fonts ? Details, choose Subpixel and Slight.
- Restart OpenOffice (including the Quickstarter) and Firefox. These two don’t reflect changes automatically.
We’re making two choices here:
- Native bytecode interpreter vs the autohinter. I’m not completely sold on one over the other.
- 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>
Tushar Burman — Oct 23, 2008 12:45:22 PM — # ↩
Testing
Trying this. My initial impression is that system-wide fonts are suddenly darker and larger, as well as a bit blurry. With full hinting, the fonts effectively have no smoothing applied, while with slight, they do and look dirty. Still, we'll see how I like it in extended use.
Kiran Jonnalagadda — Oct 23, 2008 5:29:19 PM — # ↩
I couldn't take the blurriness anymore, so spent some time looking at how to enable slight hinting in specific instances. I've updated the post.
srid — Mar 9, 2009 6:35:08 AM — # ↩
Screenshots?
How does the result compare?