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

Anti-aliasing (AA) is the process of of smoothing jagged lines caused by the nature of drawing a straight line on an angle over a grid (ie an array of pixels).

Anti aliasing does this by making some of the pixels along the jagged edge semi-transparent.

In linux (well, XFree86), there are a couple of different ways to get anti-aliased fonts in your application.

Application support

Newer X11 applications can use the anti-aliasing support that is built into the libXft/freetype font libraries. For example, this is what Mozilla uses to achieve anti-aliasing. See MozillaNotes for hints on setting up nice fonts in Mozilla.

GNOME 2 and KDE 3

From what I understand, both of these desktop environments use anti-aliasing by default, so you do not need to do anything.

GNOME 1.2

Well, this is really for applications using the GTK widget set (gtk1.2), which includes most GNOME programs. You need to make sure your X server (or font server) is using libfreetype (a font library).

You can load a library that modifies the font-drawing parts of the libraries to include anti-alias support. The draw back of this is that some widgets (such as text lists) don't behave properly so the text gets double-struck instead of anti-aliased or get confused :( If you want to try this method, you need to install the library (apt-get install libgdkxft0) and then follow the instructions in the README files (/usr/share/doc/libgdkxft0/README.Debian). You need to set and export the LD_PRELOAD variable to be /usr/lib/libgdkxft.so before running a gtk application for it to use AA. For me (running debian woody), my X server is set up to use Microsoft's truetype fonts, so I editted /etc/gtk/gdkxft.conf to add a line "-microsoft-*", and then all I had to do was "export LD_PRELOAD=/usr/lib/libgdkxft.so" and run gtk programs.

KDE 2

(This is from memory, so might be incorrect). Similar to the GNOME2 section above, AA support in KDE 2 is done at the widget level (using QT). Your X server must support libfreetype. You need to export a variable, "QT_XFT=1" and any QT apps you run with that variable set should use anti-aliasing.