O'Reilly logo

Essential ActionScript 3.0 by Colin Moock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Missing Fonts and Glyphs

Earlier we learned that when a text field is rendered using device fonts, if a given character's font is not installed on the end user's operating system, Flash Player will automatically ask the operating system to render the character in an appropriate substitute font.

By contrast, when a text field is rendered using embedded fonts and a given character's font is not available in the list of embedded fonts, Flash Player first attempts to render the character using any available variation of the specified font. For example, consider the following code, which uses two variations of the font Verdana:

var t:TextField = new TextField();
t.embedFonts = true;
t.htmlText = "<FONT FACE='Verdana'>Hello <b>world</b></FONT>";

Notice that the font for the word "Hello" is set to Verdana, normal variation, while the font for the word "world" is set to Verdana, bold variation. At runtime, if the embedded font Verdana, bold-variation is not available, but the embedded font Verdana, normal-variation is available, then the text "Hello world" will be rendered entirely in Verdana, normal-variation. If, however, neither the normal variation nor the bold variation of Verdana is available, then the character is not rendered at all, and no text appears on screen!

Tip

When using embedded fonts, if the text in your application mysteriously goes missing or appears in the wrong font variation, chances are the required fonts are not available. To determine which fonts are available at runtime, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required