LF Tip: Switching off font anti-aliasing



AuthorImage:[Here we need a little image from you]

[Photo of the Author]

TranslationInfo:[Author + translation history. mailto: or http://homepage]

original in en Guido Socher

AboutTheAuthor:[A small biography about the author]

Guido has still a few tips he can post here but not in unlimited numbers. If you like this one or any previous tip and you have also some ideas for tips that could be useful then send them to me in an e-mail. They will be posted here under your name. A picture of you does not have to be included. It is optional.


This is a small tip. From now on LinuxFocus will have at least one new tip every month. If you have some ideas for a new tip then send them to guido(Q)linuxfocus.org





Font anti-aliasing is a method of making fonts more smooth and round by adding grey dots at the edges and corners. To use anti-aliasing is unfortunately the default setting in most of the newer linux distributions.

I hate it because those fuzzy looking letters cause headaches when I read text on the screen. I prefer a high quality, sharp font in shells and text editors.

The solution

Here is how to turn it off for gdk based applications:
setenv GDK_USE_XFT 0
export GDK_USE_XFT=0
and for Qt based applications this can be done with:
setenv QT_XFT 0
export QT_XFT=0
KDE based Qt applications overwrite this unfortunately and you have to use the KDE control center (see below) even if you do not run KDE.

Here is how this looks like. Left is a screen shot from a shell window with anti-aliasing and right without.
Setting the "Font Rendering" option in the gnome-control-center to Monochrome turns anti-aliasing also off (but not everybody uses the gnome desktop). Under KDE you can unselect the Appearance&Themes->Fonts->Anti-Aliasing option from kcontrol.

It is possible to finetune the anti-aliasing behaviour on a per font bases. You can e.g disable it for just the lucida fixed width font if you are using this font in your texteditor/shell. Edit the file /usr/X11R6/lib/X11/XftConfig:
        any family == "lucida"
        edit antialias = false;

To not anti-alias small font sizes you can use:
           any size < 15 
           antialias = false;
Be aware that some distributions generate and overwrite this XftConfig file (look at modification time of the file). Hopefully this file has then a line like 'includeif "~/.xftconfig"' in which case you can add you personal modifications to ~/.xftconfig in your home directory.