Getting nice looking TrueType fonts on Fedora Core

October 11, 2006

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:

  1. set up a sane RPM build environment.
  2. get the FreeType source RPM and unpack it.
  3. find the line near the start of freetype.spec that says '%define without_bytecode_interpreter 1.' Change the 1 to a 0.
  4. change the Release field to mark your change; I usually add '.cks.0' or the like to it.
  5. optionally, add an entry at the top of the %changelog section about this.
  6. rpmbuild -bb freetype.spec
    (you may need to install some -devel RPMs that it needs)
  7. update to your new FreeType RPM with 'rpm -U' or the like.
  8. 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).

Written on 11 October 2006.
« A spectacular web spammer failure
How stable my AMD 64-bit systems have been »

Page tools: View Source, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Wed Oct 11 23:15:34 2006
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.