Penguin
Note: You are viewing an old revision of this page. View the current version.

Rasterizing a straight line or even a curve drawn at an angle over a rectangular grid, ie an array of pixels, causes jagged edges, as shape can only be approximated. Antialiasing (AA) alleviates the unpleasant impression by blending pixels against the background depending on how far from the ideal line they protrude. Although the line is just as jagged as before, this makes the human eye suspend disbelief and perceive a jag-less, smooth edge.

Although there is a lot of buzz around antialiasing, you may be better off with the high-quality outline fonts that come with the standard X Server if you have a decent resolution and are viewing fonts between around 8 and 14 points. However, anti-aliasing makes a vast improvement on laptop LCD displays.

In XFree86, there are several prerequisites to getting anti-aliased fonts in your applications:

Note that not all of your scalable fonts can automatically be antialiased. Only TrueType or Type1(?) fonts get the VIP treatment. HowToTTXFree86? describes how to use TrueType fonts with XFree86 4.x. FontNotes has more links to font-related information for Linux

Application support

Newer X11 applications can use the antialiasing support that is built into the Xft/FreeType libraries.

GTK2 and Qt 3

Both of these toolkits support antialiasing by default.

GTK 1.2

You need libgdkxft, a library that modifies the font-drawing parts of the libraries to include anti-alias support. Unfortunately the library is buggy and the project is dead, so you are stuck with some widgets occasionally exhibiting faulty text rendering. To use this library, install it (apt-get install libgdkxft0) and export LD_PRELOAD=/usr/lib/libgdkxft.so. All GTK 1.2 applications started from that shell should be using AA. Be sure to RTFM (/usr/share/doc/libgdkxft0/README.Debian).

Qt 2

Export QT_XFT=1 and you're set.

Mozilla

This is, at the core, a GTK application. Note that it can be compiled against either 1.2 or 2.x. In the former case, the HTML rendering engine will still be able to use antialiased fonts natively, but the widgets will remain unantialiased unless you go through the libgdkxft contortions described above. See MozillaNotes for the settings you need to add to your preferences to enable antialiasing.