David Turner's LCD ClearType-like patches and packages for Debian


Update: 2006-08-24 

Notice: These patches will dramaticly improve your LCD's font rendering capibility. But the Author David Turner is still too unsure of the patent situation regarding this technology to do that now.

You can find some info about these patches in the following urls:

http://lists.nongnu.org/archive/html/freetype-devel/2006-05/msg00044.html
http://lists.nongnu.org/archive/html/freetype/2006-04/msg00012.html

 

patches:

de7cccfcca8e686bca039a985436548e  libcairo-1.2.4-lcd-cleartype-like.diff
731121a3dfc663b9e4e5c4ad2e158f22  libxft-2.1.8.2-lcd-cleartype-like.diff
70d23f3557750c0503689d3314958d89  freetype-2.2.1-subpixel-disable-quantization.diff

patched packages for Sid(unstable):

68e361134f6dbce0f591065cf98c25c5  libcairo2_1.2.4-2_i386.deb
9d298e0f1d34cd5f446c9299f6ce7478  libcairo2-dev_1.2.4-2_i386.deb
3eced55b48a1ea154d85f95cd0cebac3  libxft2_2.1.8.2-9_i386.deb
033dae2d9d3c40401daa811f978b5448  libxft-dev_2.1.8.2-9_i386.deb
13eb398cf3d2476cbdf0993d4ec068ad  libfreetype6_2.2.1-3_i386.deb
4722d65b8398ce481b69fa8d0a2b173c  libfreetype6-dev_2.2.1-3_i386.deb

patched packages for Etch(testing)

b2f0d64ec6652e764bf0c6ec100271de lcd-cleartype-debs-for-etch.tar.bz2

 

Another ClearType patch for libxft2,beautiful Chinese but bad English,and you should turn on hintfull:

c4dcdea642fd02cd2f9bf9d3d4c43cfa john-cleartype.tar.bz2 

Howto: patch and build the packages

Reference link:

Improve font rendering; premade debs and instructions to patch yourself:

http://www.ubuntuforums.org/showthread.php?t=239570&highlight=dpkg-buildpackage

$ mkdir cleartype && cd cleartype
$ mkdir patch debs
 

Copy following patches to patch dir:

freetype-2.2.1-subpixel-disable-quantization.diff
libcairo-1.2.4-lcd-cleartype-like.diff
libxft-2.1.8.2-lcd-cleartype-like.diff

Satify the dependances:

$ sudo apt-get install build-essential devscripts fakeroot
$ sudo apt-get build-dep libcairo2 libxft2 freetype

1. patch libcairo2 and build package

$ mkdir libcairo2 && cd libcairo2
$ apt-get source libcairo2
$ cd libcairo-1.2.4
 

$ dch -i
something like below:
  * David Turner's ClearType-like LCD filtering patch and fix
    Cairo to enable light-hinted subpixel rendering
ctrl + o save and quit
 

$ patch -p1 <../../patch/libcairo-1.2.4-lcd-cleartype-like.diff
patching file src/cairo-ft-font.c
$ dpkg-buildpackage -rfakeroot -us -uc
 

$ cp ../libcairo2_1.2.4-2_i386.deb ../../debs/
$ cp ../libcairo2-dev_1.2.4-2_i386.deb ../../debs/

$ cd ../../

2. patch libxft2 and build package

$ mkdir libxft2 && cd libxft2
$ apt-get source libxft2
$ cd xft-2.1.8.2
 

$ dch -i
something like below:
  * David Turner's ClearType-like LCD filtering patch and fix
    xft to enable light-hinted subpixel rendering
ctrl + o save and quit
 

$ patch -p1 <../../patch/libxft-2.1.8.2-lcd-cleartype-like.diff
patching file src/xftfreetype.c
patching file src/xftglyphs.c
$ dpkg-buildpackage -rfakeroot -us -uc
 

$ cp ../libxft2_2.1.8.2-9_i386.deb ../../debs/
$ cp ../libxft-dev_2.1.8.2-9_i386.deb ../../debs/

$ cd ../../

3. patch freetype and build package

$ mkdir freetype && cd freetype
$ apt-get source freetype
$ rm -rf freetype-2.2.1
$ tar xvf freetype_2.2.1.orig.tar.gz
$ cd freetype-2.2.1.orig
$ tar xvjf freetype-2.2.1.tar.bz2
$ cd freetype-2.2.1
$ patch -p1 </path-to-cleartype/patch/freetype-2.2.1-subpixel-disable-quantization.diff
patching file src/autofit/aflatin.c
 

$ cd .. &&  rm -rf freetype-2.2.1.tar.bz2
$ tar cvjf freetype-2.2.1.tar.bz2 ./freetype-2.2.1/
$ rm -rf freetype-2.2.1
 

$ cd .. && rm -rf freetype_2.2.1.orig.tar.gz
$ tar cvzf freetype_2.2.1.orig.tar.gz freetype-2.2.1.orig
$ rm -rf freetype-2.2.1.orig
 

$ md5sum freetype_2.2.1.orig.tar.gz
8e5c64c0fb8db2a8fd52b02179ea9896  freetype_2.2.1.orig.tar.gz
$ ls -l freetype_2.2.1.orig.tar.gz
-rw-r--r-- 1 root src 1450823 2006-08-24 00:42 freetype_2.2.1.orig.tar.gz
$ vi freetype_2.2.1-2.dsc
Files:
 8e5c64c0fb8db2a8fd52b02179ea9896 1450823 freetype_2.2.1.orig.tar.gz
$ dpkg-source -x freetype_2.2.1-2.dsc
 

$ cd freetype-2.2.1

$ dch -i
  * Disable quantization when subpixel is on
$ dpkg-buildpackage -rfakeroot -us -uc
 

$ cp ../libfreetype6_2.2.1-3_i386.deb ../../debs/
$ cp ../libfreetype6-dev_2.2.1-3_i386.deb ../../debs/

Install the patched packages:

$ cd cleartype/debs
$ dpkg -i *.deb 


Last step  but it is important if you want to get the beautiful fonts:

run gnome Font Preferences, goto Detail panel:


Screenshot: