" /> Nabeel Al-Shamma: May 2007 Archives

« December 2006 | Main

May 11, 2007

Font Smoothing in Flash Player

The Flash Player uses font smoothing in two basic ways.

First, if a font installed on your computer is being used (called device font or device text), then we use the operating system to draw the text. This means it will use ClearType on Windows if it is turned on, or, font smoothing on the Macintosh or Linux if it is turned on. Thus, Flash Player text using device text will look just like operating system text.

Second, if a font is embedded in the SWF, or, is linked to from a SWF (called embedded font or SWF font), we will use font smoothing, also known as anti-aliasing, that is built into the Flash Player. This high fidelity font smoothing has been around since Flash Player 8. The font smoothing doesn't use the original hints in a font, but preserves character outlines, and then applies auto-hinting. Text which is drawn using embedded fonts looks the same on all operating systems.

Another thing to note is that we provide some dials and knobs for font smoothing when authoring. For example, the designer can select “anti-alias for readability” or turn a couple of knobs for custom settings in Flash. These settings can also be set using ActionScript API’s. (Note that if you use “anti-alias for animation” Flash Player draws using Flash vectors, which provides smooth animations.) Again, these are only available to the author or designer, not to the user of Flash Player.

For bitmap font fans, the Flash authoring application can export pixel snapped (“bitmap”) fonts as an embedded font. This uses the shape drawing in the player, but looks exactly like the original bitmap representation. As long as you don’t scale it, of course.

I do understand that font smoothing can be a very personal taste. Some folks like to turn it off altogether, while others, like me, can’t imagine going back to bitmap text (and jaggies).

Let me know if you find this helpful in understanding how font smoothing works in Flash Player or have other comments about drawing text.

May 09, 2007

Font Smoothing in Reader & Acrobat

Adobe Reader and Acrobat have had font smoothing for numerous releases. Early on it was an option that needed to be enabled in preferences. We now have it on by default. But, the default setting is for CRT's. You need to explicitly change the settings for LCD displays:

1. Go to preferences (Cntrl-K or Cmd-K)
2. Choose "Page Display" under "Categories" on the upper left corner of the dialog
3. For "Rendering" select "For Laptop/LCD Screens" for the "Smooth Text" option

Font smoothing for CRT's is good, but I see a noticeable difference when I turn on smoothing for LCD's. We use a number of techniques to optimize for LCD's. One major one is to take advantage of the greater resolution of LCD's due to the layout of the parts of a pixel. On a CRT, there are three blurry dots that make up a pixel. On an LCD, there are red, green and blue subpixels next to each other, usually in the horizontal row. We can take advantage of this to position characters (I'm going to use the word characters, but I should really be saying glyphs to be technically accurate) with greater fidelity, essentially to 1/3 pixel resolution. With font smoothing, we've always had the ability to position characters at subpixel positions, typically at 1/4 pixel resolution for CRT's. This improves character spacing.

We also play a number of tricks with the scaling and sampling of characters, and with stem alignment with pixels. Control of color is critical, both in the overall color of the text (which is essentially the number of pixels turned on and the uniformity of "grayness" of a paragraph), and in the minimization of color ghosting (which can make your text look like it is decorated with Christmas lights).

Please try turning on smoothing for LCD Screens. I'd love to hear about how it changes your reading experience.