What I have learned during the last two days is that people tend to have vastly different preferences regarding font rendering. Some want their fonts crisp and clear, maybe even without Anti-Aliasing, while others want them really smooth, almost a bit blurry. The actual problem was, that in Debian (Squeeze) subpixel rendering is really nice everywhere else than in applications relying on libcairo for achieving that. This leads to Firefox having almost unreadably sharp fonts when hinting is set to full, while they tend to look just ugly when hinting is at a lower level.
Comparing rendering of fonts in Firefox (or other GTK-apps) to e.g. qt-apps like Konqueror made me want to fix that problem. At first it seemed like nobody else had noticed that behaviour and I thought it would just be nit-picking again, as I always want things to be “perfect” in one or the other sense. But finally, today I found this thread talking about the exact issue that was bugging me. So I read through it carefully and finally found a solution to my problem. There are two possibilities, both involving libcairo and libdirectfb:
- Ubuntu packages can be used. Ubuntu has a patch applied to libcairo (and seemingly libdirectfb) which makes font rendering look much nicer. You can actually install these packages without problems. Just get them from the Karmic repository.
- Use patched packages provided by Hadret in the linked thread. You can find them here. Actually, these are the AMD64 packages. Read through the thread to get the i386 ones or build them yourself. A link to the patch guide should also be given in that thread.
Having these packages installed, you just have to enable subpixel rendering and set hinting to an appropriate value. Personally, I like slight hinting the most as it gives the whole thing a really smooth look. Settings can be made system-wide in /etc/fonts or per-user in ~/.fonts.conf. Here are the contents of my ~/.fonts.conf:
1 <?xml version='1.0'?>
2 <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
4 <match target="font" >
5 <edit mode="assign" name="rgba" >
9 <match target="font" >
10 <edit mode="assign" name="hinting" >
14 <match target="font" >
15 <edit mode="assign" name="hintstyle" >
19 <match target="font" >
20 <edit mode="assign" name="antialias" >
Finally, Firefox (and XChat, and Icedove, and…) font rendering looks fine again :-)
Note that it may be necessary to upgrade some packages to versions from Debian sid (e.g. xulrunner-1.9.1) to make this work.