Explanation of fonts

This page tries to explain how fonts work under linux. This is basically a copy of a message I sent to the gentoo user mailing list to explain why fonts look the way they do under different applications

The look of the fonts is determined by freetype. A full desktop has it installed a couple of times. Openoffice and mozilla come with their own, statically linked versions. Then X has it's version, and finally there is the freetype ebuild that installs freetype in /usr/lib. In the current gentoo version this is not so bad anymore as most packages have been changed to use the shared version

Due to a patent owned by Apple, the freetype library comes standard with the bytecode interpreter disabled. People who either don't care about patents, or think the patent is not valid, or live in a country where the patent doesn't apply can enable this bytecode interpreter with the setting described in the recent article on www.register.co.uk. Standard the gentoo compiled libraries enable this feature, as without it fonts are butt ugly. The binary version of openoffice doesn't have it enabled though. The trick with LD_PRELOAD="/usr/lib/libfreetype.so" oofice actually forceably disables the freetype that comes with openoffice and replaces it with the system library.

Now, there are multiple ways for programs to use fonts:

Gui toolkits such as gtk and qt often put another abstraction layer above these methods and provide for a unified font object that can be influenced with gtkrc files in the case of gtk. It does not handle rendering though, so 12pt courier new is as ugly in qt as in gtk. The only difference is available in the backends, as the core font method doesn't allways give results equal to the xft method. Gtk and Qt both allow user choice of the backend, but modern versions both use Xft by default.