Hi. I'm Andrew

Filed under: firefox

See all posts on posterous with this tag » 

A better font rending in Ubuntu

I've been tinkering quite often ever since I upgraded from a Firefox 3.4 to Firefox 3.5 in Ubuntu Intrepid version 8.10. I wasn't satisfied as to how the fonts are being rendered. So I've searched for solutions or a workaround. I was glad that I found a tutorial via kilobitspersecond.com. I thought it was the best workaround available that the Web has to offer for Ubuntu users but I'm still wasn't satisfied of the output.

And Just recently, I've searched for a different solution and found this via linuxtidbits.wordpress.com. A workaround that's quite overwhelming when looking at the code for .fonts.conf file. But when I tried using it, for the first time I was satisfied of the rendering output both in Firefox 3.5 and the desktop system.


Here's the code I've used for ~/.fonts.conf script thanks to linuxtidbits.wordpress.com

<?xml version='1.0'?><!DOCTYPE fontconfig SYSTEM 'fonts.dtd'><fontconfig> <!-- General Settings --> <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> <match target="pattern" >  <edit mode="assign" name="autohint" >   <bool>true</bool>  </edit> </match> <match target="font" >  <edit mode="assign" name="lcdfilter">   <const>lcddefault</const>  </edit> </match> <!-- set dpi --> <match target="pattern" >  <edit mode="assign" name="dpi" >   <double>88</double>  </edit> </match> <!-- consolas and inconsolata appear fuzzy --> <match target="font">  <test compare="eq" name="family">   <string>Consolas</string>  </test>  <edit mode="assign" name="hintstyle">   <const>hintmedium</const>  </edit> </match> <match target="font">  <test compare="eq" name="family">   <string>Inconsolata</string>  </test>  <edit mode="assign" name="hintstyle">   <const>hintslight</const>  </edit> </match> <!-- hintmedium for small fonts, reduces fuzziness --> <!-- pretty sure this doesn't work --> <match target="font">  <test compare="less_eq" name="pixelsize">   <double>11</double>  </test>  <edit mode="assign" name="hintstyle">   <const>hintslight</const>  </edit> </match> <!-- calibri jaggedness --> <match target="font" >  <edit mode="assign" name="embeddedbitmap" >   <bool>false</bool></edit> </match> <match target="font">  <test compare="eq" name="family">   <string>Arial</string>  </test>  <edit mode="assign" name="hinting">   <bool>true</bool>  </edit>  <edit mode="assign" name="hintstyle">   <const>hintfull</const>  </edit>  <edit mode="assign" name="autohint">   <bool>true</bool>  </edit>  <test compare="less" name="weight">   <const>medium</const>  </test> </match> <match target="font">  <test compare="eq" name="family">   <string>Impact</string>  </test>  <edit mode="assign" name="hinting">   <bool>true</bool>  </edit>  <edit mode="assign" name="hintstyle">   <const>hintfull</const>  </edit>  <edit mode="assign" name="autohint">   <bool>false</bool>  </edit> </match></fontconfig>

Update: December 1, 2009
Thanks to @wilmon. If you happen to just let the font spacing/kerning to use the normal or default space, just comment out the following code block as seen below:

<!-- <match target="font">  <test compare="eq" name="family">   <string>Arial</string>  </test>  <edit mode="assign" name="hinting">   <bool>true</bool>  </edit>  <edit mode="assign" name="hintstyle">   <const>hintfull</const>  </edit>  <edit mode="assign" name="autohint">   <bool>true</bool>  </edit>  <test compare="less" name="weight">   <const>medium</const>  </test> </match> -->

And here are my screenshot font rending output. See the detailed comparison with or without using the /~.fonts.conf code. Spot the detail in spacing and the redish and greenish color surrounding the font/letter forms. See what screenshot is much more readable.

(download)

~.fonts.conf code courtesy via linuxtidbits.wordpress.com

Filed under  //   firefox   fonts   howto   typography   ubuntu  

Comments (9)