My biggest gripe on any GNU operating system is the poor font rendering. Because of patents held by biggies like Microsoft and Apple, many interesting font rendering technologies cannot be applied on Linux without the chance of getting sued.
Perhaps the best patch available for font rendering is the LCD cleartype patch from Freetype maintainer David Turner. Though this patch is no longer available from Turner, you can download it from several places on the internet. I have shared one of them here. Let us see how we can apply this patch on Mandriva 2007. Ubuntu users, please refer to my another interesting howto here.
We need the following 3 files:
Extract all the packages to a folder:
$ tar -xzvf filename.tar.gz
Now we need to apply the patches for individual packages.
For freetype, there is no patch, but we can edit the file manually. Go to your freetype source folder, and open the file aflatin.c:
$ vim ./src/autofit/aflatin.c
Search for the term FT_RENDER_MODE_MONO. You will find two instances. Remove the OR statement that follows this in both cases. It will read like the following once you edit it:
if ( mode == FT_RENDER_MODE_MONO )
other_flags |= AF_LATIN_HINTS_VERT_SNAP;
You are done patching freetype.
Now go to the xft folder and run:
patch -p1 < path/to/your/libXft-2.1.10-etcpatchfile
Go to the cairo folder and run:
patch -p1 < /path/to/your/cairo_patch
You are done with all the patching. Now, go to individual folders for these packages and run:
$ ./configure --prefix=/usr
$ make
Now login as root and:
$ su # make install # exit
This will overwrite the default libraries that shipped with your system. Repeat the same for all the other packages.
Go to font preferenes and select sub-pixel font rendering.
Just restart X (Ctrl+Alt+Backspace) and enjoy your new beautiful Mandriva!
Sample:
Acknowledgements: This guide is based on a thread in Ubuntu forums.
I am just wondering about the command “patch” I’m currently running mandriva 2007 but as far as I can tell “patch” is not a command.
Thanks for the help.
-Steve
Comment by Steven Shannon — November 30, 2006 @ 9:02 pm
@Steve,
Did you install all the development tools? You can open MCC and check the Development tools section so that all relevant software like gcc, patch etc., are installed.
Comment by jaganath — December 6, 2006 @ 8:15 am
I tried everything here exactly as you coded, but two problems occured… first off, when I went to do the ./make and ./make install commands inside each of the source folders, it said that it was an invalid command. But if I just typed make and make install it worked, or at least I thought it did. However, upon restarting X, there wa
Comment by Eo Nomine — December 31, 2006 @ 2:31 am
oops, sorry, got cut off for some reason…
Upon restarting X, there was no difference at all in the fonts. I don’t know if it’s because of the make and make install commands or something else that is causing this not to work.
Any ideas what the problem might be? Thanks for the help, I’d really like to get this working!
Comment by Eo Nomine — December 31, 2006 @ 2:32 am
@Eo Nomine,
Oops. You found a some errors in this post!! I corrected them.
After running
./Configure and
make
you must then login as root run make install (because it will install files in /usr folder)
Let me know if it works. (It should)
Comment by jaganath — December 31, 2006 @ 8:08 am
Awesome, it works, although the fonts didn’t actually change until I turned subpixel smoothing on and adjusted the hinting, even after running the patches. (I have an LCD laptop screen) It was stuck on either monochrome or grayscale before, can’t remember which one.
I can’t believe how friggin gorgeous the fonts look now, my biggest hate about linux is now resolved… thanks a lot for this article and the help!!
While I have your attention, one other quick question. Can this be applied to any distro, or is it Mandriva specific? I also run FC6 and openSUSE right now and would like to apply it to them as well.
Thanks again,
-EN
Comment by Eo Nomine — December 31, 2006 @ 8:52 am
@ Eo Nomine
Thanks. It should work on Fedoora and OpenSuSE too. But I havent tried. Let me know the results on these.
Comment by jaganath — December 31, 2006 @ 5:27 pm
Good news, I tried this with FC 6, and everything worked perfectly, so it’s safe to assume that this isn’t distro-centric, and will work with anything. Probably a good idea to keep an eye on what packages you’re getting when updating though, just in case one of these libraries gets updated and you lose the changes you made. Although patching it isn’t difficult, so really it would onlly be an inconvenience.
Thanks again,
-EN
Comment by Eo Nomine — January 25, 2007 @ 6:38 am
I tried this on openSuSE 10.2-64, but nothing changed.
‘Subpixel order’ setting still has no effect,
i still have the ‘ugly’ b/w antialiasing.
BTW: Firefox did not start after this, it claimed
errors ‘wrong library typ ELFCLASS64′ or something. The ‘make install’ seems to overwrite the 32bit libraries with the 64bit versions.
I used yast to reinstall (update unconditionally)
the libs, and firefox worked again.
Comment by Ralf — January 30, 2007 @ 5:00 pm
Some remarks to your description:
In ‘patch -p1′ it is not very clear, that this is
-p and not -p
Difficult to read, depends on the font.
The ‘./configure –prefix=/user’ line ist missing a line break. This hit me even beeing an experienced user.
Comment by Ralf — January 30, 2007 @ 5:04 pm
In the above it should read:
-p(number one) and not -p(lowercase L)
I wrote it with angle brackets. My fault, sorry.
Comment by Ralf — January 30, 2007 @ 5:06 pm
I have built the rpms for FC6 for interested parties:
download here.
Comment by Jim Bevenhall — March 17, 2007 @ 1:59 pm
@Jim
Thanks
Comment by Jaganath — March 17, 2007 @ 8:23 pm
Sorry, but I can’t figure out where to get the XFT and Cairo patch files. Are these supposed to be on http://www.megaupload.com/? To get them from that site it appears you need at least a filename to search for. Or am I missing something in your text?
Comment by Tom — March 28, 2007 @ 9:08 pm
Alternatively, to use the rpms, the instructions say to “Download and replace these rpms for fc6.” In FC6, where in the file system are the originals I need to replace?
Comment by Tom — March 28, 2007 @ 9:11 pm
I’m sorry for the running commentary, but perhaps it will help others. I finally figured out that’s not a search box at http://www.megaupload.com/, but a capcha – you have to enter the three letters to the left of the box and then wait about a minute, then you can download the file.
So I have the patches. When I enter the patch command, the terminal takes it without error messages, but I don’t get control of the terminal back. Both patch commands appear to hang until I control-c out of them. What would cause this?
Comment by Tom — March 28, 2007 @ 9:56 pm
@Tom,
You dont need to manually replace them. Once you have copied these to a respective folder, do:
rpm -ivh *.rpm
This will replace your current ones with the downloaded ones.
Comment by Jaganath — March 29, 2007 @ 9:20 am
Usefull information and all is good arranged. glucometer
Comment by Glucometer — June 8, 2007 @ 1:30 pm
Am I weird if like DejaVu Sans, Purisa and Gentium more than MS fonts?
Comment by Livio — October 18, 2007 @ 6:02 pm
You are just retarded with your grammars, nothing else.
Comment by grigorij — October 18, 2007 @ 10:03 pm
[...] techniques among other things. The patches I found to work were from this page: http://jaganath.wordpress.com/2006/11/16/cleartype-lcd-patch-on-mandriva-linux-2007/ . I started getting annoyed when I would update Fedora and these libraries would be [...]
Pingback by infinality.net » Blog Archive » David Turner Patched Libraries for Fedora 8 x86_64 — December 23, 2007 @ 10:08 pm
Hello. Could you, please, update?
Comment by Jayrome — May 22, 2009 @ 6:35 pm
Yes, please update your story !
Comment by Eric — September 27, 2009 @ 3:40 am
good blog. thanks a lot.
Comment by TV wall mount bracket — July 8, 2010 @ 6:17 pm
Thank you for another great write-up. Exactly where else could anyone get that type of data in these a ideal way of writing? I have a presentation next week, and I am to the look for this kind of information and facts.
Comment by escort — February 10, 2011 @ 10:22 pm
You actually allow it to be seem so easy with your presentation but I’ve found this topic to be actually something which I believe I would never understand.
Comment by wardrobe closet — May 14, 2011 @ 1:25 pm
I know this is really boring and you are skipping to the next comment, but I just wanted to throw you a big thanks – you cleared up some things for me!
Comment by Kitchen Appliances — July 11, 2011 @ 10:54 pm
Sarah Maxwell
Comment by wear evening wedding — September 16, 2011 @ 7:05 am
Yeah but what should I say instead of agree with that?
Comment by Alte Weiber geil vögeln — August 10, 2012 @ 6:22 pm