Fog Creek Software
Discussion Board




AntiAliasing Text

Let's suppose that I'm making a word processor...

Would it be wise of me to allow the users of my program to select the level of antialiasing applied to the text they are typing?

I was thinking this may help people by giving them a choice, but it might also confuse them.

AnyMouse
Saturday, April 10, 2004

Shouldn't this be a global setting implemented by the text generating display code in the operating system?

Except for very unusual cases I don't see why a word processor should be dealing with pixel rendering of fonts. In every modern GUI I know of it's done by the operating system display engine, and the decision should and must be made at the display driver level.

Joel Spolsky
Fog Creek Software
Monday, April 12, 2004

Microsoft poured a whole lotta money into creating the ClearText display type for LCD screens, and people are really happy with it.
Messing with that seems like a formula for angry users.

Philo

Philo
Monday, April 12, 2004

Philo you are funny...

> whole lotta money

http://grc.com/cleartype.htm

Li-fan Chen
Monday, April 12, 2004

Uh, I don't understand your point, Li-fan. Yes, there's a nice page explaining the technology. Yes, the concept is based on something the Woz did ages ago.

And yes, several Microsoft R&D types spent a whole lotta hours making it work right - there are font issues, kerning issues, chromatic issues, making sure it works in every application, making sure APIs still work right, etc, etc...

Personally, I'm really impressed by the work MS is doing on typography and publishing. But obviously I'm biased. :)

http://www.microsoft.com/typography/default.mspx

Philo

Philo
Monday, April 12, 2004

Adobe did its own anti-aliasing technology for Adobe Reader. You can use it instead of ClearType if you like.

But then again, Adobe reader is multi-platform and Adobe is the leader in electronic typesetting. If you're not Adobe, making your own text anti-aliasing is very probably a terrible idea.

Chris Nahr
Tuesday, April 13, 2004

"If you're not Adobe, making your own text anti-aliasing is very probably a terrible idea." True - I have worked on anti-aliasing for Symbian and Research In Motion among others, and it can be a pain in the arse, what with gamma correction and the ambiguity between coverage and transparency. But if you must roll your own, why not use (or borrow ideas and routines from) the excellent and mature code in FreeType? I'm sure everyone has heard of FreeType, but just in case, it's an open-source typeface rendering library with a non-viral license.

Graham Asher
Friday, April 16, 2004

Even if you *are* Adobe, it's really hard to do good anti-aliasing. I wrote the first anti-aliasing code for Adobe Type Manager some ten or so years ago, and it really was not good at all. It was the kind of anti-aliasing that gave anti-aliasing a bad name. (I used a simple oversampling algorithm: Render at a larger size than you're displaying, and add up the pixels in each N x N block to compute a grayscale value. Really a bad idea!)

Later, someone much smarter than me wrote some really good anti-aliasing code that's now used in Acrobat and other Adobe products.

But (definitely not speaking for Adobe here, and hoping I don't get in too much trouble for saying it!), to my eyes it still doesn't look as good as ClearType. On my high-density ThinkPad display (15" 1600 x 1200, 133 pixels per inch), ClearType text is marvelously readable even at small point sizes.

I think part of the reason is that TrueType fonts have a lot more hinting information for small point sizes. Subpixel rendering certainly helps, but Adobe's CoolType does that too. I don't really know why ClearType works so well, but it does.

What's interesting to me is that Apple does such a bad job of anti-aliased text. Text quality on my Powerbook is terrible compared to my ThinkPad.

A while back I got curious about this and took some screen shots of the same text on the Mac and Windows XP, blown up with two different zoom programs:

http://www.geary.com/images/mactext.png

http://www.geary.com/images/xptext.png

In each screen shot, the top image is blown up with a conventional "zoom in" program that does not know about subpixel rendering. The bottom image is blown up with a zoom in program that I hacked to display the RGB subpixels. This is why the bottom images have vertical RGB stripes in the white background--that is what you'll see if you take a magnifying glass to an LCD display.

The Mac version has numerous problems. If you look at the tops and bottoms of the lowercase L's, you can see how they fade out at the top and bottom instead of being clipped neatly. Each "l" is rendered differently, where on the Windows version they are all the same. The Mac's lowercase "e" lacks definition and just looks sloppy.

It's not a completely fair comparison because the fonts are not identical, but all of the text on my Mac in any font is fuzzy and illegible compared to the beautifully readable ClearType text on my ThinkPad. The Mac's text somewhat resembles the naive oversampled text I used way back when on Adobe Type Manager, except that it does use subpixel rendering.

So, I agree, unless you're Adobe or Microsoft, don't try to do your own anti-aliasing. Not even if you're Apple!

Michael Geary
Monday, April 26, 2004

I can't comment on the Mac comparison but Microsoft's new TrueType fonts definitely contribute a lot to screen readability on Windows, with or without ClearType.

Tahoma, Verdana, Georgia etc. were specifically designed and hinted for the relatively low resolutions of a computer screen, and it shows -- they look as good at small sizes as a bitmap font that was handcrafted for that size. They do look a bit too coarse for print output, though.

Chris Nahr
Monday, April 26, 2004

You guys should watch the videos from Bill Hill on Channel9. He's the guy who runs the team that developed ClearType:

How does ClearType work?
http://channel9.msdn.com/ShowPost.aspx?PostID=5221

Why isn't ClearType on by default in Windows XP?
http://channel9.msdn.com/ShowPost.aspx?PostID=4913

Do you think anyone is going to read a book on the screen?
http://channel9.msdn.com/ShowPost.aspx?PostID=4295

There is only one space after a period
http://channel9.msdn.com/ShowPost.aspx?PostID=112

Hope you enjoy these.
What were the influences in your life?
http://channel9.msdn.com/ShowPost.aspx?PostID=4047

Windows is not the most  important OS.
http://channel9.msdn.com/ShowPost.aspx?PostID=114

Robert Scoble
Monday, April 26, 2004

I learned from a discussion on Robert's blog today that the Macintosh text rendering was improved in Panther. The screen zooms I linked to earlier were taken on Jaguar. I updated the Mac version for Panther, so here are all three:

http://www.geary.com/images/mactext-jaguar.png

http://www.geary.com/images/mactext-panther.png

http://www.geary.com/images/xptext.png

The Panther text is indeed much better than the Jaguar version. The ClearType version from XP still looks the best to me, but the Panther version is close.

If anything, this reinforces the essential point: Anti-aliasing is really hard to do well, and it even took Apple a couple of tries to get it right.

Michael Geary
Tuesday, April 27, 2004

*  Recent Topics

*  Fog Creek Home