Birnam Designs is a quality web design and development agency in Virginia

jumping text wrap in Flash 8

The new “anti-alias for readability” setting for text in Flash 8 and up looks really good. The only problem is that there are sometimes unexpected behaviors related to text wrapping. That’s because, by default, the advanced antialiasing uses “grid fitting”, which is not used by traditional (anti-alias for animation) text. Grid fitting is a text rendering technique that aligns horizontal and vertical lines in the font glyphs to a whole pixel. For instance, say you have a lower-case ‘L’ that is draw as a one-pixel wide bar. In order to render it as crisply as possible, that one-pixel wide bar should be lined up with the monitor’s actual pixels.

Unfortunately, this alignment process can alter the width of the text, which can alter the wrap points in multiline textfields. This normally wouldn’t be noticeable in static text fields, but it is very obvious if the textfield is being animated. Especially when being scaled! The text will jump around as the wrap points keep changing.

The way out of this is to use Actionscript to adjust the gridFitType property of the textfield. “animation” anti-aliased text has the gridFitType property set to “none”. Any “readability” anti-aliazed text has this property set to “pixel” by default, which yields the most legible text. There is also a “subpixel” option, which uses the subpixel grid of an LCD monitor instead of whole pixels. In terms of text quality, “subpixel” falls between “pixel” and “none.”

In order to avoid the text jumping around, set this to something other than “pixel.” Try “subpixel” to start with, and see if that works. It seems to depend on how much the textfield is animated. If you’re still getting jumps, you’ll have to go down to “none.”

It’s not the ideal solution, because it will mean lower quality text. But it will almost certainly be preferable to the jumping text. I would like to see a future version of flash that will be able to keep the text width the same regardless of grid fitting.

Comments are closed.