WPF ClearType and the case of the blurry font

While at TechEd I had lunch with IanG and the discussion around the blurry text in WPF came around. I mentionned that this was due to sub-pixel positioning: fonts are now positioned based on where the font designer intended to put it rather than at the pixel boundary. You gain in accuracy but you loose in sharpness. I also mentioned that fonts were rendered fatter on mac to account for this blurriness, and spent a couple of days wondering if I said somehting very stupid.

So I googled a bit and found where I got some of these ideas. Let me direct you to Joel on Software for the beginning of your cyber journey towards font understanding. I am lead to believe by all I've read that at small font sizes ClearType doesn't respect the font weight and spacing properly in GDI ClearType, while it's respected much better on the WPF ClearType, making it much closer to MacOS X sub-pixel rendering.

The problem, as Joel points out, is that users don't like change. They end up considering WPF text as blurry, when a mac user would find them absolutely appropriate. Should Microsoft backtrack on their ClearType WPF work? The problem would be that to respect the pixel grid, you need a pixel grid, and in WPF you don't have one. Ouch.

One thing I forgot to mention as well is that some of your blurry text comes from using Menus and other windows with transparency. This will disable ClearType altogether and switch to gray-scale rendering. When you wonder which mode each window is, make a screen capture and zoom, you'll see the red and green artifacts. And that includes every menu you use in your application (how's that for a hidden gem).

[Update]

While browsing wikipedia I stumbled on the following text.

Increasingly, new approaches to screen rendering have reduced the importance of extensive TrueType hinting. Apple's rendering approach on Mac OS X ignores almost all the hints in a TrueType font, while Microsoft's ClearType ignores many hints, and works best with "lightly hinted" fonts.

One additional potential explanation of the difference between GDI and quartz sub-pixel rendering.

Technorati Tags: ,

Ads

Comment