Thursday, August 07, 2008

Sub-pixel Anti-Aliasing on Linux

After my accident with the Linux Oracle Binary Image last week, I've been using Linux exclusively on my notebook. It has been somewhat of a pain, but I'm surviving! (quite a feat, after two years of a Windows desktop). I even got the wireless working.

But something has always been bugging me about Linux: how to optimize the Cairo font-rendering engine to get really good anti-aliased text.

Now this may be old hat to the hardened Linux crowd, but it's a sufficiently major discovery for me.

First of all: what is the sub-pixel order? it turns out that the vast majority of LCD displays have RGB pixel order, which is why this is the default.

You can determine the sub-pixel order for your particular LCD by going to this: Lagom LCD test. Windows users don't have to do this, as they have the ClearType Tuning Wizard (not installed by default on XP, but you can get it from MSDN somewhere).

A second important note: (and I just learned this five minutes ago) do not enable full hinting! for some reason, full hinting make sub-pixel anti-aliased text look worse than regular full-pixel anti-aliased text. Although do note that on a CRT, full-pixel AA is the only game in town.

The Lagom site recommends to use "slight" or "medium" hinting. After I switched from full hinting to medium hinting, there was a huge improvement in visual clarity, it's so not funny.

Have fun with your LCD!

No comments: