Ok, I promise. This will be my last post on font rendering in Linux!
As usual, while tweaking some of the Linux font settings, I accidentally discovered that you can make X render fonts **exactly** as in OS X! (Don’t ask me how it works. I do not know. But it works perfectly!)
This is what I did:
- Removed all the existing font customizations that I have done earlier
- Made sure that I do not have a .fonts.conf in home directory.
- Made sure that only the default .conf files that shipped with Dapper are in /etc/fonts folder.
- Ensured that I have the Turners cleartype patch installed.(If you do not know how to apply patches or if you are too lazy to apply your own patch, grab the precompiled patched binaries from here.). Update: Ubuntu Edgy Eft users can get precompiled binaries with Turner’s patch here.
- Made sure that I have all the .ttf fonts from my Windows installation in Ubuntu too.
- Reconfigured fontconfig by running:
sudo dpkg-reconfigure fontconfig
On the first screen, I selected “None” and on the second and third screens I said no. Fontconfig will update your font settings and regenerate your font cache.
Turned on sub-pixel rendering in gnome font settings.
Restart X: ctrl+alt+backspace.
Here are some screenshots: (Tahoma never looked so better.)
Digg home page:
This post as it was typed:
This blog post (Using wordpress preview. Look at Lucida Grande in all its glory!)
Update : Turns out that Mac uses “byte code interpretation” to achieve this font rendering. The fontconfig that we do in the above steps turns on BCI in freetype too. Hence the similar rendering effects. Because of this, you don’t need to install Turner’s patches – so ignore step 4.