Fonts as sharp as razors: Crux ports for -LCD patches

Edit: Unfortunately, the images originally included in this post are gone, because of hosting problems in late 2009. My apologies.

One of the things I always find amazing when I install Arch Linux is the patches for cairo, fontconfig and libxft that are specific to LCDs. Install those packages on a laptop, adjust the X settings to your hardware and it’s like you installed a new screen. Simply beautiful stuff.

Looking to mimic the same razor-sharp edges on my Crux system, I came up with three ports and hijacked two others, all of which I’ll duplicate here, just for future reference. I don’t maintain a Crux repository, so if you’re interested, you’ll have to copy-and-paste, manually update and then compile. But you might end up doing that anyway, so it probably won’t bother you.

Another over-exuberant thank-you to Colin Zheng, whose PKGBUILD2Pkgfile script was, once again, simply invaluable in this process. Two seconds and a brief edit, and these Pkgfiles were done.


# Description: Cairo vector graphics library (with custom LCD filter).
# URL:
# Maintainer: 
# Depends on: libpng xorg-libxrender fontconfig xorg-libpixman xorg-libxcb pkg-config

source=($version.tar.gz lcd-filter.patch)
build () 
    cd cairo-$version;
    patch -p1 < ../lcd-filter.patch || return 1;
    ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-xcb --disable-static || return 1;
    make || return 1;
    make DESTDIR=$PKG install || return 1

LibXft-LCD. I have my CHOST variable set to i686-pc-gnu-linux or whatever, but I don’t think it’s truly necessary for this. Let me know if I’m wrong and I’ll trim those parts out.

# Description: FreeType-based font drawing library for X (with custom LCD filter)
# URL:
# Maintainer: 
# Depends on: fontconfig xorg-libxrender pkg-config

source=($version.tar.bz2 libxft_export.diff xorg-lib-libXft-lcd-filter.patch)
build () 
    cd libXft-${version};
    patch -Np0 -i ../libxft_export.diff || return 1;
    patch -Np1 -i ../xorg-lib-libXft-lcd-filter.patch || return 1;
    ./configure --prefix=/usr --sysconfdir=/etc --build=${CHOST} --host=${CHOST};
    make || return 1;
    make DESTDIR=$PKG install || return 1


# Description: A library for configuring and customizing font access (custom LCD filter).
# URL:
# Maintainer: 
# Depends on: fontconfig

build () 
    install -D -m644 10-lcd-filter.conf $PKG/etc/fonts/conf.avail/10-lcd-filter.conf || return 1

Note that Cairo-LCD depends on xcb-util, which in turn is dependent on gperf. Both of those I found in the mxq repository, and I’ll copy here, just in case that’s not available.


# Description: number of libraries which sit on top of libxcb
# URL:
# Maintainer: Bartlomiej Palmowski, maks1k at wp dot pl
# Depends on: xorg-libxcb gperf


build() {
    cd $name-$version
    ./configure --prefix=/usr --disable-static
    make DESTDIR=$PKG install


# Description: perfect hash function generator
# URL:
# Packager: Mattias Hedenskog <>
# Maintainer: Bartlomiej Palmowski, maks1k at wp dot pl


build() {
    cd $name-$version
    ./configure --prefix=/usr \

    make DESTDIR=$PKG install
    rm -rf $PKG/usr/share

Thanks to the real maintainer for those.

Oh, and how do they look, you ask?

That’s probably not a very good example. And the JPG conversion loses some quality. But it should give you an idea.

P.S.: Don’t forget to download the actual patches, probably from the Arch repositories, and include them in the port directory. Otherwise, these just plain won’t work. :mrgreen:

Edit: Here’s the LM Roman 10 at 10-point in Leafpad. The image doesn’t really look as good as what’s on my screen, and I seem to have the best luck with 9-point fonts, but this isn’t bad for a 96dpi 1600×1200 screen. In my own humble opinion, of course. ;)

About these ads

5 Responses to “Fonts as sharp as razors: Crux ports for -LCD patches”

  1. 1 Colin Zheng 2008/10/29 at 10:57 AM

    Hi kmandla,

    When I was using Arch, I was able to get xft+freetype to render the Latin Modern opentype fonts (almost) as perfectly as Xpdf renders Computer Modern.

    When I switched to CRUX, somehow, even after rebuilding patched libxft, freetype2 with BCI, etc, I could never get the same nice-looking result anymore.

    Since you have the patched versions, could you help me see how those odf fonts look on you X? (say lmroman10-regular.otf from that link)

    P.S it’ll be good to have Pkgfile for freetype with BCI enabled.
    P.P.S it’s good to see that the converter script is put to work

  2. 2 K.Mandla 2008/10/29 at 11:11 AM

    I use that script all the time, Colin. Thanks a million for that. :D

    I’ll tack a second screenshot on the post. I don’t think images are allowed in comments.

  3. 3 Colin Zheng 2008/10/29 at 11:24 AM

    :) glad to know, you are very welcome
    You could also email me the screenshot, when you have time for it. It’s not at all urgent for me

  4. 4 Colin Zheng 2008/10/29 at 11:32 AM

    Thanks, I saw it. Looks the same as what I had on CRUX though. Never mind, I’ve bid farewell to all serif fonts and anti-aliasing now. They simply look horrible on a 32″ LCD at the resolution of 1360×768, lol.

  5. 5 tkovacs 2008/11/05 at 10:39 AM

    On your menubar S and O are so smudged… same goes for all CAPS and then those ugly bastard combinations like “mp”, “na”, “BU”… (all on first ss, second is so ugly it hurt my eyes).

    I’ve never understood Linux haters whose main argument are smudged fonts (besides everyone has their own idea how fonts should look like), same goes for those LCD patches. Because I always had good results on Linux with a little tweaking and without BCI or any LCD patches. I belive good results can be made with what we have now (without any specialised patches) for linux desktop to look crisp.

    Nice little operation your have going on, cheers.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Visit the Wiki!

Some recent desktops

May 6, 2011
Musca 0.9.24 on Crux Linux
150Mhz Pentium 96Mb 8Gb CF

May 14, 2011
IceWM 1.2.37 and Arch Linux
L2300 core duo 3Gb 320Gb

Some recent games

Apr. 21, 2011
Oolite on Xubuntu 11.04
L2300 core duo 3Gb 320Gb

Enter your email address to subscribe to this blog and receive notifications of new posts.

Join 405 other followers


This work is licensed under the GNU Free Documentation License. Please see the About page for details.

Blog Stats

  • 3,963,431 hits



Get every new post delivered to your Inbox.

Join 405 other followers

%d bloggers like this: