Flash font size limit

It seems that Flash has a limit for the font size. Normally, it displays the text with a font size of up to 127 px. So I tested it to see if there’s any workaround for this limitation and the easiest thing to do is set the size of the font to less than 128 px and then scale the text field until the size of the font suites your needs. This is what Colin Moock recommends in his article.

However, it seems that there is an exception to this font size rule: if you add a text field to the Stage using the Text tool in design time and not using code in runtime, it lets you use font sizes greater than 127 px (I’ve tested it with a font size of 300 px) ONLY AND ONLY if you DO NOT USE the “Render text as HTML” option. I’ve tested it with all three types of text field: dynamic, static and input; with and without embedded fonts; with single line and multiline; with and without border; using device fonts, bitmap fonts and anti-aliased fonts. And it worked with several types of fonts.

So, if you would like to use font sizes greater than 127 px and your text is static, just place that text in design time and don’t use it as HTML text. You can even update the contents by code and the font size will be kept, even when using the htmlText property to set the new text. But it seems that as soon as you use the “Render text as HTML” option on the text field, the font size limit kicks in. When you use code to create and set the text field, that rule always applies.

The new Flash Text Engine from Flash Player 10 no longer has this limit when using the new TextElement class, but the limit is still applied to all traditional text, according the Colin Moock’s article.

5 thoughts on “Flash font size limit

  1. Thanks for the link to Moock’s. Too bad about that size limit, it’s such a pain.

  2. Yeap. It’s too bad. But it’s still good that there’s this workaround, though it takes you a little time to get to the font size you want.

  3. Thanks,
    This is much better then scaling the font, I tried that and it made the letters jaggy.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">