November 05, 2003

Small things making differences

Seeing as how it has been several moons since my last posting, I feel somehow compelled to make this very posting a return to form: namely, an incredibly minuscule yet rather useless observation, preferably pertaining some technical mumbo-jumbo. Originally it was going to be a review of SSX 3 for Daisie (a review which is still forthcoming, I might add), but then Sonya had the wherewithal to request an elaboration on a subject that arose during Novemberfest goings-on this weekend last. And so, without further ado, screen fonts.

Some people have noticed that the system font in Mac OS X 10.3 Panther has changed. The font itself is the same Lucida Grande, but the manner in which it is rasterized, or converted to pixels, or drawn to the screen, has changed but slightly. All versions of Mac OS X have used a technique called antialiasing when drawing the system font when used for controls (menus, buttons, etc.), with each major OS release improving the manner in which this antialiasing is performed. Panther includes the requisite improvements but with a lemon meringue twist: the font is subtly warped. Allow me to demonstrate:

Keen observer that you undoubtedly are, you will have likely noticed a subtle difference between Mac OS X 10.2 Jaguar and 10.3 Panther. Some may say the Panther version of the text (as seen in Safari's address bar) is narrower, but both versions are exactly the same width, even if I wasn't thoughtful enough to provide a visual comparison (you'll have to take my word for it). Some may instead say the Panther version is taller or otherwise bigger, but the height of the tallest letters in both versions (also known as the cap height) are the same height -- have a gander at the upper red guide. Some may say I'm taking my sweet time getting to the point, and those people would be absolutely correct.

In the Jaguar version, you'll note that letters such as e end up with a bit of "fuzz" at the top. This fuzz is due to letters being not quite tall enough to line up with a row of pixels, and the process of antialiasing results in gray pixels. Our brains (one apiece) interpret these gray pixels as half-pixels, or very nearly so, thus providing the effect of a higher-resolution display on the cheap. This is not to say that antialiasing is perfect, however. Especially when used with smaller font sizes, it can result in, well, lots of gray pixels. Which is where Panther comes in.

What's going on here is that Panther warps the system font when drawing controls such that its x-height (the height of a lowercase letter such as x that has no ascender or descender) has an integral pixel measurement. In other words, Panther attempts to limit minimize the number of gray pixels. It's interesting to contrast this method of algorithmically increasing legibility with Adobe Type 1 fonts, which contained "hints" as to how the font was to be rasterized. The best screen fonts are designed to the pixel by hand, but this is obviously a tedious process: designing versions of a font for 9- and 10-point sizes in this manner is equivalent to designing two separate fonts. Type 1 fonts can be designed once and tweaked for individual sizes, but are as equally time-consuming to produce as bespoke fonts when compared to the pure algorithmic approach as found in Panther.

Everything sounds perfectly lickable so far; there must be a catch, no? As I see it, there are two. First is that the mechanism is only tuned for horizontal edges. If you look again at the Panther example above (or not, I won't take it personally), you'll note that each of the two t's in "http" is rendered differently: one has a bit of fringing along its lower left side, while the other has a clean intersection of its two strokes. Ideally, any perfectly horizontal or vertical strokes would be drawn using only full pixels; currently this is only possible for horizontal strokes. This is a minor shortcoming, however, compared to the underlying philosophical objection, and that is that Panther's font smoothing turns fonts that have been designed to within a pica of their existence into completely new fonts, ones that were not intended by font designers. A particular Panther-drawn font could have been considered by that font's designer and rejected. What's more, this problem is compounded by the fact that this redesigning of a font must be redone for each size at which the font is used. If the same font is used in multiple sizes, each size will very likely differ in its proportions from its cohorts, resulting in the effect of multiple fonts -- a situation commonly known as a typographical disaster.

The reason I tried to keep the doom and gloom to a minimum (and a single paragraph is fairly minimal, don't you think?) is that, for the most part, the whole scheme is just kooky enough to actually work. By and large, text is moderately more legible on screen than it was in Jaguar (although not quite on par with Windows ClearType, it would seem). It would be nice if there were an option to disable Panther's new trickery, but for most users the change is a nice one, if a subtle one.

Posted by ned at November 5, 2003 12:17 AM