Firefox Bug – Font Rendering Problem In Ubuntu
I was compiling Firefox 3.5 on Ubuntu and I did all the optimizations and stuff to get better font rendering in it (see my other tutorial), but it seems that Firefox 3.5 has a bug; The font rendering is really bad even when you have all the configure options set and you have a subpixel hinting enabled build of cairo (default in Ubuntu). Here’s the bug filed at launchpad: https://bugs.launchpad.net/ubuntu/+source/firefox-3.5/+bug/379761
Here’s the comparison:
The middle one is FF 3.5. See any difference in the fonts? Yup, that’s what the bug is all about.
But don’t worry, there’s a workaround for it, you just need to edit one file (create it, if it doesn’t exist). You see, the problem is that Firefox takes the font rendering settings directly from Freetype2, and Freetype2’s default settings are not always good for everyone, so if you’ve tweaked the font settings via the ‘System->Preferences->Appearance’ menu, you won’t see any change in Firefox 3.5. Although, Firefox 3 works fine.
OK, enough blabber, here’s what you have to do.
First of all, create a file named ‘.fonts.conf’ in your home directory (edit it, if it already exists) and change it to your hearts content ![]()
Here’s mine:
<?xml version='1.0'?> <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> <fontconfig> <match target="font" > <edit mode="assign" name="rgba" > <const>rgb</const> </edit> </match> <match target="font" > <edit mode="assign" name="hinting" > <bool>true</bool> </edit> </match> <match target="font" > <edit mode="assign" name="hintstyle" > <const>hintslight</const> </edit> </match> <match target="font" > <edit mode="assign" name="antialias" > <bool>true</bool> </edit> </match> </fontconfig>
All I did was change the hinting to “true”, initially it was ‘false’ so I replaced it with ‘true’.
And, ” hintstyle” I changed it to ‘hintslight’. You need to see which is good for you, ‘hintfull’ or ‘hintmedium’.
You can check your font options (System->Appearance and click on the ‘Fonts’ tab and then click on ‘Details’
and change the file according to those settings.
Please Note: This workaround was taken from the Ubuntu forums from this post.



