≡ Menu

Ubuntu Linux: Firefox and Desktop Application Fix Smooth Font Problem ( Render Font Correctly )

Q. How do I render font smoothly in Ubuntu Linux / Gnome desktop systems? How do I get look a likes of the Microsoft / Mac OS X smooth fonts for Firefox and other applications?

A. Due to legal issues font related problem is not fixed by default. Font rasterization is the process of converting text from a vector description to a raster or bitmap description. This often involves some anti-aliasing on screen text to make it smoother and easier to read. It may also involve “hinting”, that is, the use of information precomputed for a particular font size.

Font preference tool

To get smooth fonts click on System > Preferences > Appearance > Select Fonts tab.

Use the Font preference tool to choose which fonts are used in different parts of the desktop, and the way in which fonts are displayed on the screen.

Fig.01: Ubuntu Linux ( Gnome ) Font preference tool

Fig.01: Ubuntu Linux ( Gnome ) Font preference tool

To specify how to render fonts on your screen, select one of the allowed Rendering option. Since I’m using LCD screen I will use techniques that exploit the shape of individual Liquid Crystal Display (LCD) pixels to render fonts smoothly. Use this option for LCD, flat-screen displays and Laptop computers.

Other font options

  • Monochrome: Renders fonts in black and white only. The edges of characters might appear jagged in some cases because the characters are not antialiased. Antialiasing is an effect that is applied to the edges of characters to make the characters look smoother.
  • Best shapes: Antialiases fonts where possible. Use this option for standard Cathode Ray Tube (CRT) monitors.
  • Best contrast: Adjusts fonts to give the sharpest possible contrast, and also antialiases fonts, so that characters have smooth edges. This option might enhance the accessibility of the GNOME Desktop to users with visual impairments.

Create / Update ~/.fonts.conf file

Fontconfig is a library designed to provide system-wide font configuration, customization and application access. Your default font config file is located at /etc/fonts/fonts.conf (global file). Do not edit this file. Put all your custom configuration in $HOME/.fonts.conf file. ~/.fonts.conf is the conventional location for per-user font configuration, although the actual location is specified in the global fonts.conf file. Type the following command:
$ vi ~/.fonts.conf
$ gedit ~/.fonts.conf
Paste following configuration:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
 <match target="font" >
  <edit mode="assign" name="autohint" >
 <match target="font" >
  <edit mode="assign" name="rgba" >
 <match target="font" >
  <edit mode="assign" name="hinting" >
 <match target="font" >
  <edit mode="assign" name="hintstyle" >
 <match target="font" >
  <edit mode="assign" name="antialias" >

Save and close the file. Close all applications and restart Gnome by pressing CTRL + ALT + Backspace keys. Once logged in open Firefox or any other application to see new smooth fonts.

Understanding config directives

~/.fonts.conf is an XML tree format configuration file.

  1. autohint set to true to use autohinter instead of normal hinter.
  2. rgba set to none to use subpixel geometry
  3. hinting set to false to avoid the rasterizer for hinting
  4. hintstyle set to none i.e avoid automatic hinting style
  5. antialias set to true so that glyphs can be antialiased


Share this tutorial on:

Your support makes a big difference:
I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft, takes a lot of my time and hard work to produce. If you use nixCraft, who likes it, helps me with donations:
Become a Supporter →    Make a contribution via Paypal/Bitcoin →   

Don't Miss Any Linux and Unix Tips

Get nixCraft in your inbox. It's free:

{ 10 comments… add one }
  • Some Guy October 27, 2008, 3:33 am

    What is this legal issue of which you speak?

  • Shai March 29, 2009, 5:34 pm

    Thanks for posting this. I am using eeebuntu nbr and no matter what I did the fonts looked awful until I followed your steps. Thanks!

  • Shai March 29, 2009, 8:38 pm

    Me again. One question about making these changes: the fonts in Firefox now look awesome, but they are also a lot smaller than before (ie, now appear to be size 8 or 9 rather than size 10 or 11). I’d rather not have to zoom the text on every website I visit. Before creating the custom fonts.conf they were the right size, just not smooth. What can be done about this?

  • nixCraft March 29, 2009, 10:13 pm

    Open Firefox > View > Zoom > Reset

    Also, check your Preferences ( View > Preferences) and select Content tab. Make sure correct font and size set.


  • Shai March 29, 2009, 10:32 pm

    Open Firefox > View > Zoom > Reset
    No impact. Zoom was already at 100%.

    View > Preferences
    You mean Edit > Preferences. Anyway, these settings are all the same as they were before creating fonts.conf. Advanced is “Allow pages to choose their own fonts” which is what it should be.

    I know the font size now is incorrect because I am looking at my own website, and it is not displaying correctly, whereas it did before, just without smooth fonts.

  • Sandeep November 5, 2009, 2:21 am

    Thanks a lot! The fonts in Firefox look much better now. Why isn’t this setting enabled in Ubuntu by default??

  • Kiat July 20, 2010, 2:55 pm

    thanks, i just tried your suggestion in Fedora 13. It´s all now look sharp!

  • Olaf November 2, 2010, 2:56 am

    Thanks a lot for your solution. I was already about to re-install the computer!!!

    What was the reason for the problem: I used Digikam and had to play around with the colors. It seems that during these operations KDE created the ~/.font.conf file which was corrupted and caused the problems. To be able to continue using KDE applications, like Digikam, I created the ~/.font.conf file as you proposed as root with only root having rw access. Therefore KDE can not change the file anymore – it works!

    Thanks :)

  • Mihai T July 5, 2011, 12:14 pm

    I had this problem of font rendering after I unninstalled KDE Plasma Desktop in Ubuntu 11.04.
    Your solution worked for me, now I have the fonts properly rendered in Firefox.


  • Ben January 3, 2012, 9:57 pm

    Thanks a lot! I installed and then removed gnome-shell on Ubuntu 11.04 and that seems to have uglified my application fonts. Fixed now, with your help!

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">

   Tagged with: , , , , , , , , , , , , , , , , , ,