Getting nice looking TrueType fonts on Fedora Core
Some TrueType fonts look significantly worse on some Linux distributions than on Microsoft Windows or MacOS. This is due to the usual reason that things suck on Linux: patents. TrueType fonts can have special hints for looking good at low resolution, but using those hints is apparently covered by some Apple patents in (some) countries with software patents.
(For the gory details, see here.)
Pretty much everyone on Linux uses the FreeType library to render TrueType fonts. FreeType has implementations of the patented stuff, but Fedora Core (and I believe some other Linux distributions) build the system FreeType libraries with it disabled due to the patent issues.
So to get nice looking TrueType fonts, all you need to do is rebuild the FreeType RPMs with the patented bytecode interpreter enabled, like so:
- set up a sane RPM build environment.
- get the FreeType source RPM and unpack it.
- find the line near the start of
freetype.specthat says '
%define without_bytecode_interpreter 1.' Change the 1 to a 0.
- change the
Releasefield to mark your change; I usually add '
.cks.0' or the like to it.
- optionally, add an entry at the top of the
%changelogsection about this.
rpmbuild -bb freetype.spec
(you may need to install some -devel RPMs that it needs)
- update to your new FreeType RPM with '
rpm -U' or the like.
- restart the X font server so that it's using the new FreeType shared
library: quit X, then do
/etc/rc.d/init.d/xfs restart, then restart X.
On an x86_64 machine, you probably want to rebuild both the native 64-bit RPM and the i386 version (and now you know why I was looking into cross-build RPMs yesterday). Rebuilding only the 64-bit RPM will leave any 32-bit programs that directly use FreeType with bad-looking TrueType fonts; this includes OpenOffice, ImageMagick, and a 32-bit Firefox (if you've installed one in order to get Flash et al working).