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.
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"> <fontconfig> <match target="font" > <edit mode="assign" name="autohint" > <bool>true</bool> </edit> </match> <match target="font" > <edit mode="assign" name="rgba" > <const>none</const> </edit> </match> <match target="font" > <edit mode="assign" name="hinting" > <bool>false</bool> </edit> </match> <match target="font" > <edit mode="assign" name="hintstyle" > <const>hintnone</const> </edit> </match> <match target="font" > <edit mode="assign" name="antialias" > <bool>true</bool> </edit> </match> </fontconfig>
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.
- autohint set to true to use autohinter instead of normal hinter.
- rgba set to none to use subpixel geometry
- hinting set to false to avoid the rasterizer for hinting
- hintstyle set to none i.e avoid automatic hinting style
- antialias set to true so that glyphs can be antialiased
- fonts.conf man page
- Font rasterization
- Original Ubuntu Linux thread about smooth fonts
- Sexy, smooth fonts on (K)Ubuntu