Created attachment 37182[details][review]
Add support for using freetype to handle subpixel LCD text rendering
David Turner, the upstream freetype author, has written a patch for
libXft to use the freetype subpixel text rendering hooks in the API. In copies of freetype which do not have the subpixel text rendering code enabled, these calls are effectively NOOP, they do not render any differently.
Attached is the patch that I applied (after a bit of cleanup) to
Fedora's rawhide libXft and tested. Because Fedora's freetype doesn't do
any real subpixel text rendering, there is no difference between the
session with libXft patched vs unpatched.
For proof, I offer screenshots of xterm -fa Monospace:
http://spot.fedorapeople.org/libXft-lcd-patch/BEFORE-xterm-fa-Monospace.pnghttp://spot.fedorapeople.org/libXft-lcd-patch/AFTER-xterm-fa-Monospace.png
The core benefit of this patch is that:
* Users who have the legal option of running freetype with enabled
subpixel text rendering will see that functionality enabled across
libXft and cairo.
* When those patents expire (or are declared invalid), libXft
will not require any changes to leverage a freetype with enabled
subpixel text rendering.
As an additional note: this patch has been applied to Debian's copy of libXft for some time now.

Hmm, you're right. I could have sworn I saw it in the Debian patchset, as I don't normally even bother digging in Ubuntu packages for patchsets.
My apologies! The rest of the bug ticket still holds, though. :)

The patch unfortunately does not apply any more, and the current one in the
downstream http://patches.ubuntu.com/x/xft/xft_2.2.0-3ubuntu1.patch also does
not apply to current git.
If you were to update the patch to current git, I would be happy to review it
and wrangle it in to a release.

FC_LCD_FILTER was added in 2008 and is in 2.5.92. It seems better to me that
we rely on a version of fontconfig with FC_LCD_FILTER. I pushed your changes
along with a followup to remove ifdef-fu:
To ssh://git.freedesktop.org/git/xorg/lib/libXft
0e0efb8..550b2f7 master -> master
Thanks