Wandering Thoughts archives

2006-10-11

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:

  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).

linux/NiceTrueTypeFonts written at 23:15:34; Add Comment

A spectacular web spammer failure

In the spirit of earlier heroic failures, I just saw someone attempt to put an entire POST form in the actual HTTP request. No, really. The incoming request looked something like this:

login=%5Burl%3Dhttp%3A%2F%2Fwww.nextlevelnews.com%2F [.. elided ..] %2F70.html%0D%0A+&view=login&page=blog%2Flinks%2FBestToolPOST /~cks/space/.login HTTP/1.1

This is perhaps the most abject spammer failure I've seen.

(It also confirms that web spammers are targeting my login form as well as the 'post a new comment' form; I have a theory on that, which doesn't fit in this margin.)

Unsurprisingly, the request came from a charter.com cablemodem that is currently in bl.spamcop.net and the CBL, among other places.

web/StupidSpammerTricksII written at 17:42:09; Add Comment


Page tools: See As Normal.
Search:
Login: Password:
Atom Syndication: Recent Pages, Recent Comments.

This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.