Nicer fonts for Fedora Core 4 and 5
Site Navigation:

Nicer fonts for Fedora Core 4 and 5

Author:  Sven Knispel
Updated:  [udate]

Updated for Fedora Core 5 on 2006-04-17
Ever since I am using Fedora Core I have been complaining about the poor rendering of fonts: they look ugly and unsharp.

The reason of the poor rendering is that FreeType is compiled by default with the bytecode interpreter switched off. I didn't find the real reason for that but it seems related to some patent issues.
This article is about reconfiguring Fedora Core for a neat font rendering. It has been tested with Fedora Core 4 and 5:

  • Replacing freetype with bytecode interpreter activated
  • Selecting fonts
  • Setting antialiasing
  • Font settings for non KDE apps

1. Replacing freetype with bytecode interpreter activated

Fortunately it is quite simple to turn the bytecode interpreter on by recompiling freetype after a slight change:

  • get the source rpm
  • make the required changed
  • recompile and install the modified freetype version

Alternatively, if you don't want to recompile freetype you can get the binary RPMs compiled with bci from here.

1.1. Getting the sources

First we must heck for current version of freetype:
# rpm --query freetype
# freetype-2.1.9-2

Then download the sources, e.g. from rpm.bone:
(I suggest downloading the binary rpm as well in case of dammage as we will freshen the installed one)
Install the sources:
sudo rpm -ivh ./Desktop/freetype-2.1.9-2.src.rpm

1.2. Enabling the bytecode interpreter

Change to the directory /usr/src/redhat/SPECS and edit freetype.spec.
What we are looking for is: %define without_bytecode_interpreter 1 and we want to replace it by: %define without_bytecode_interpreter 0 in order to enable the bytecode interpreter.

1.3. Rebuild and install

After having changed the code we need to rebuild the RPMs:
rpmbuild -bb freetype.spec (if you get errors make sure that XFree86-devel is installed as freetype depends on it)
If the build was successfull the result can be found in /usr/src/redhat/RPMS/i386/: [~]$ cd /usr/src/redhat/RPMS/i386/
[i386]$ ls -l
total 3268
-rw-r--r-- 1 root root 824001 Oct 21 15:28 freetype-2.1.9-2.i386.rpm
-rw-r--r-- 1 root root 1781435 Oct 21 15:28 freetype-debuginfo-2.1.9-2.i386.rpm
-rw-r--r-- 1 root root 105464 Oct 21 15:28 freetype-demos-2.1.9-2.i386.rpm
-rw-r--r-- 1 root root 585133 Oct 21 15:28 freetype-devel-2.1.9-2.i386.rpm
-rw-r--r-- 1 root root 25476 Oct 21 15:28 freetype-utils-2.1.9-2.i386.rpm
Now check for the ones you need to reinstall with rpm --query <package-name> (e.g. rpm --query freetype-devel) and reinstall whatever is required with the force option as they are already installed in the original version: rpm -Uvh --force freetype-2.1.9-2.i386.rpm
rpm -Uvh --force freetype-devel-2.1.9-2.i386.rpm
That's it!
Now just restart X and enjoy...

2. Selecting fonts

The quality of rendering, especially for small sizes is depending on the quality of the fonts. The Microsoft fonts Verdana and Tahoma are famous for their crispness, even all small sizes like 8 pt. If you don't have a problem with patented fonts I recommend installing these. They can be found in the webcore fonts package, or you can copy them from an installed Windows.

3. Selecting antialiasing

Antialiasing is a technique for "bluring" edges of fonts in order for them to look sharper. I a font reders wenn at small sizes I recommend turning antialiasing off. My setting is to turn antialiasing off for all sizes < 9 pt.

3.1. Results

And here is the comparison before and after:
before after

4. Font settings for non KDE apps

If you are using KDE you may have noticed that the settings from KDE are not inherited to Qt applications. Especially Firefox keeps showing bigger fonts not corresponding to the KDE font-settings.

After some research I found out how to force the fonts for non KDE applications:

  • the gnome font-settings must be changed. This can be done by exectuting gnome-font-properties and select e.g. Tahoma 8 as default font
  • under KDE the gnome-settings-daemon mus be started: this can be done e.g. by adding a symlink to /usr/libexec/gnome-settings-daemon from ~/.kde/Autostart (ln -s /usr/libexec/gnome-settings-daemon ~/.kde/Autostart/gnome-settings-daemon)

Note:If you have only KDE installed you need to install the package control-center in order to get gnome-font-properties.

5. Further references

  • The Font mini-howto with a lot of background information and some alternative tips for the ones who do not want to use MS fonts