Fonts

Comprehensive Ubuntu Font Configuration Guide: Gutsy 7.10 edition

Even with the latest and greatest release of Ubuntu Gutsy Gibbon, font configuration in Linux can range anywhere from somewhat confusing to downright difficult. On top of the configuration difficulty, nobody can agree on what makes fonts look good. This article aims to document several approaches to font rendering, and the appropriate configuration settings to implement each approach.

Disable font smoothing for a particular font

Some fonts look better when they are rendered without font smoothing. This tip illustrates how to write a .fonts.conf configuration file so that only particular fonts are rendered without antialiasing.

Using Liberation fonts as a substitute for Arial

For people who care about how their fonts look on Linux, Arial has always been a difficult font to have rendered correctly. This tip allows you to use the free Liberation Sans font (which has the exact same metrics as Arial) in all places where Arial would be used.

Selectively enable bitmap fonts in fontconfig

Ubuntu Gutsy by default disables the use of bitmap-only fonts (a.k.a. X core fonts) through the fontconfig system. This means GTK-based applications can't see them and the user is unable to select these fonts through the standard font selection interface.

The system can be configured to allow bitmap fonts by replacing the symlink /etc/fonts/conf.d/70-no-bitmaps.conf with a symlink /etc/fonts.conf.d/70-yes-bitmaps.conf -> ../conf.avail/yes-bitmaps.conf . However doing so enables all bitmap fonts to come through, which can produce an undesired effect when rendering webpages in Firefox, as some bitmap font names may match those specified on a webpage (Helvetica and Times are common examples).

A small amount of fonts.conf magic can be used to selectively allow certain fonts to come through fontconfig, while keeping most inaccessible.

Use the 6x13 font in gnome-terminal

For better or for worse, many of us have become accustomed to the 6x13 font that has been the default bitmap font for xterm for many years.

Newer terminal programs like gnome-terminal give us updated configuration GUIs, as well as useful features like profiles and ability to directly click on URLs. But because of the font configuration mess on Ubuntu, it's impossible, with default settings, to get gnome terminal to use the same 6x13 font. The instructions below illustrate how to fix this situation (aside from just using xterm).

Optimal Font settings for Ubuntu Feisty 7.04 and Gutsy 7.10

Getting good looking fonts still continues to be difficult on Linux, but I've managed to find a configuration that looks pretty good as far as I'm concerned.

Disable font hinting for specific fonts.

The built in font-hinting support in Ubuntu sometimes does not work very well with specific fonts. The following bit of code in your ~/.fonts.conf can disable hinting for specific fonts.
<match target="font">
    <test name="family" qual="any">
      <string>UmePlus P Gothic</string>
    </test>
    <edit name="hinting">
      <bool>false</bool>
    </edit>
</match>
Replace "UmePlus P Gothic" with the name of your font.
Syndicate content