Archive for the ‘Quartz’ Category

Subpixel font rendering: A difference in philosophy.

August 23, 2007

Thursday, August 23, 2007

Every once in a while, someone writes an article that inspires me to write a blog entry that explores a topic in more detail. In this case, the credit goes to the infamous George Ou for his blog entry entitled: Vista puts Mac OS X font rendering to shame. Mind you, when an article is well written and presented with facts, there isn’t much controversy and hence, not much more to expand upon.

Rather than go into the detail of Ou’s blog, it’s safe to just summarize his article by saying he doesn’t like the font rendering technology in OS X, but not surprisingly, he does like Microsoft’s font rendering technology. Mind you, Ou has no credibility in the publishing field and he has even less credibility in basically anything IT related. Further, his blog article misses many key points which are critical in this discussion. While I’m not writing this article for the purpose of character assassination, it is worth putting the validity of Ou’s blogs in context. Based on the history of his blogs, he’s very biased against Apple. He’s probably most famous for his support for David Maynor in his botched attempt to demonstrate a bug in Apple’s WiFi drivers, but that’s a story for another day. The point is, Ou has an established history of being consistently incorrect and drawing conclusions from misinformation. He strives to be controversial. Writing outrageous articles which neglect the facts are his modus operandi. For this reason, I won’t bother dissecting his post. Instead, I’ll just give him credit for giving me a reason to write about this issue.

What is subpixel rendering and why is it used?

Have you ever noticed that fonts and drawings, etc. tend to have jagged edges, particularly around curves or diagonal lines? Yet, when you print the same text or drawing to a printer, it looks sharp and much clearer? That’s because vector based images (like Postscript, Truetype or Opentype fonts) use mathematical calculations to draw their shapes. More specifically, the typical screen resolution is in the 72 – 96 dpi (ppi) range and printers are at least in the 300 dpi range. As the resolution of the print/display medium increases, so does the accuracy of drawing.

Anti-aliasing is a means of tricking the human eye into believing you are viewing an image at a higher resolution. For example, a white diagonal line displayed against a black background will look jagged when displayed from a computer screen. The same (vector based) line, when calculated at a higher resolution (like when it’s output to a printer) will look smooth. However, there is a technique for displaying grey dots between the white edges of the line and the black background. The effect on the human eye is to have a smooth line displayed on a low resolution display.

In summary, with respects to fonts displayed on the computer screen, anti-aliasing is used to make jagged fonts appear smooth. Subpixel rendering, like anti-aliasing, is a method for font smoothing.

How does it work?

The smallest element (dot) on a computer screen is called a pixel. Each pixel, particularly on LCD screens, is comprised of a red, green and blue stripe. By varying the intensity of these different stripes, the LCD panel is able to make the pixels (dots) brighter or dimmer in addition to changing colors. Subpixel rendering basically allows the vector calculations used to draw the font to go down to the subpixel level (red, green and blue components of a pixel) in order to achieve the effect of displaying the font at a higher resolution. This method effectively triples the horizontal resolution of an LCD display. Subpixel rendering does not have the same effect on CRT displays.

History of subpixel rendering…

Manipulating the screen at the subpixel level is nothing new. This technology actually dates back to the old Apple ][ days where Steve Wozniak manipulated sub pixel data as a means of displaying more colors than the hardware was designed to. Although it was used for a different purpose, the concept is the same.

http://www.grc.com/ctwho.htm
Quote from Steve Wozniak:

“Back in 1976, my design of the Apple II’s high resolution graphics system utilized a characteristic of the NTSC color video signal (called the ‘color subcarrier’) that creates a left to right horizontal distribution of available colors. By coincidence, this is exactly analogous to the R-G-B distribution of colored sub-pixels used by modern LCD display panels. So more than twenty years ago, Apple II graphics programmers were using this ‘sub-pixel’ technology to effectively increase the horizontal resolution of their Apple II displays.”

In 1998, Microsoft announced its brand of subpixel rendering, called Cleartype. This feature was optional, but left off by default on windows XP (circa 2001). It is turned on by default in Windows Vista (circa 2007).

Apple has provided font smoothing technologies in OS X since its first consumer release in 2001. The main difference is that Apple’s font smoothing technologies employs different algorithms based on the desired setting. That is, it will use subpixel rendering for the LCD setting, anti-aliasing for CRT settings, etc.

A difference in philosophy.

Both Apple and Microsoft adopted different philosophies to address the jagged font issue. Since the philosophies are different, so are the implementations. It’s not necessarily a matter of being right or wrong as both implementations have their respective strengths and weaknesses. All the same, everyone is entitled to their opinion.

This difference in philosophy is best described in the link below.

Font smoothing, anti-aliasing, and sub-pixel rendering

“Apple generally believes that the goal of the algorithm should be to preserve the design of the typeface as much as possible, even at the cost of a little bit of blurriness.
Microsoft generally believes that the shape of each letter should be hammered into pixel boundaries to prevent blur and improve readability, even at the cost of not being true to the typeface.”

That is, Apple’s method keeps fonts true to their design at the potential loss of sharpness on very small font sizes. Microsoft’s method attempts to keep fonts as clear as possible, at the expense of the accuracy of the font.
In Joel’s example, the dot on the “i” in the word “Rendering” was slightly clearer with Cleartype. However, that came at the expense of the inaccurate difference between plain text and bold text. Cleartype messes up the “g” and the “e” characters as it forces alignment to a subpixel grid. The “R” is slightly exaggerated and the “o” is shaped as an oval instead of a circle with the Cleartype implementation. In short, Cleartype actually changes the font to the point that the font displayed is not what was intended by the font designer.

At the web site below, Damein Guard illustrates the difference in scaling between Microsoft’s Cleartype and Apple’s font smoothing. Cleartype is all over the place and Apple’s font smoothing is nice and linear. There may be a difference on a CRT, but on a quality LCD, I wouldn’t even consider Cleartype to be smoother in this example.

Damien goes on to note:

“Windows does not scale fonts linearly as the rough line points out.

Windows scales the height and width but not the weight of the font.“

My own test…

Since I am a multi-platform user, I decided to conduct my own test. That and I don’t want to run into any copyright issues by posting images created by someone else. Here’s what I found:

render technology

In my test above, I created the Windows version with Word and the Mac version with Pages. I used the same font, Arial on both. The line in blue is 12pt and the black text starts at 8pt and moves up to 16pt in 1pt increments. Note: You should be using an LCD to view this image. Here’s what I observed:

  • Even at the same font size, the Microsoft’s fonts are bigger. The larger the actual font, the easier it is to draw it correctly. So, right off the bat, there is a difference. Perhaps this has something to do with the default dpi the screens are set at?
  • In the lower font sizes (9pt – 11pt), Cleartype does appear slightly sharper.
  • I do see accuracy problems in the Cleartype rendering though. Starting with the line in blue – both the bold “e” and “g” characters are rendered incorrectly.
  • As mentioned earlier, one thing is clear. The size scales fine on both sides, but weight does not with Cleartype. With Cleartype, the weight seems to be grouped by every 3pt increments. For example, 14pt, 15pt, 16pt differ in size, but have the same apparent weight. This is a result of Cleartype forcing the output to a grid. OS X’s Quartz rendering by comparison scales very smoothly in both size and weight as one would expect.
  • When you’re given a choice between choosing slightly crisper text or more accurate fonts, it’s understandable why some would prefer going with the crisper text. If your needs are basic such as writing an e-mail, or simple word processing, Microsoft’s method might be better for you. But, if you’re doing any sort of professional work where font accuracy and spacing is important, Apple’s implementation is the better choice.

    In some respects, it’s not just a matter of personal choice. For example, if you are doing content creation using Cleartype, these font inaccuracies are then propagated to other forms of media such as web page graphics, DVDs, etc.

    Conclusion

    This discussion is focused on the difference in philosophies. However, many facts were presented along the way. The facts suggest that Microsoft’s Cleartype can appear to be clearer than Apple’s font smoothing under certain circumstances. My opinion is that the difference in clarity is negligible. The facts also show that Microsoft’s Cleartype is considerably less accurate than Apple’s font smoothing technologies. Cleartype rendered fonts are not displayed in the manner the font designer intended and the fonts don’t scale properly, especially when compared to Apple’s implementation.

    As a matter of subjective opinion, I certainly agree that some people may prefer the look of Cleartype rendered fonts over fonts rendered with Apple’s technology. However, my anecdotal evidence also indicates that people who prefer Cleartype are generally less knowledgeable about fonts in general. Personally, I share the opinion that it is not Microsoft’s place to purposely distort a font, even if the intention is for better clarity on LCD monitors.
    As others have mentioned before me, if screen clarity is the primary objective, then screen optimized fonts such as Verdana, Lucida Grande, Georgia, etc. should be used. Similarly, these screen based fonts have little character when output to print. Likewise, consideration for using the appropriate font for the appropriate occasion should be exercised. Finally, I believe font rendering technology should render fonts as accurate as possible to the intended design.

    Finally, although there is a difference between Apple’s Quartz renderer and Microsoft’s Cleartype renderer, I don’t see that the difference is really worthy of all the fuss some people seem to make of it. Both methods have advantages and disadvantages. Both Apple and Microsoft have taken different philosophies. But, is that such a terrible thing? Generally speaking, Microsoft and Apple serve different markets. I realize that the George Ou’s of the world are just looking for attention. I’m not sure what else would prompt such lopsided arguments. In any case, Windows users seem happy with Cleartype and Mac users seem happy with Quartz. They are both optimized for different purposes. Neither is perfect for all occasions and we’re all entitled to our own opinions and preferences. As stated, my opinion is that the distortion of a font is not acceptable for any reason. Whatever your opinion is on this issue, hopefully, this post helps you consider the pros and cons of both implementations of subpixel font rendering.


    Follow

    Get every new post delivered to your Inbox.