Use Embedded Fonts in Flash CS5

This page discusses one way to safely embed a font into a file so that everyone who views your SWF will see the same fonts that you are seeing. This has changed in CS5. When you open a CS4 FLA in CS5, in most cases the embedded fonts (which were embedded using CS4) will stop working.

Note that I'm not going to discuss spawning dynamic text fields with ActionScript. I'm just going to do it manually, using a "classic" dynamic text field that's on the Stage.

Also, note that this procedure is NOT NEEDED if all your text fields are "classic" static text. Those fonts embed themselves and are completely bulletproof on every user's display.

If you don't care too much what the fonts look like, select "Use device fonts" as shown at left, and you don't have to embed anything. But if a user does not have the font you specified, I think that user might see nothing at all where your font is supposed to be. So the safest practice is to select _sans, _serif, or _typewriter if you are using Device Fonts -- and those can be quite ugly.

Screen capture: Dynamic fonts, Step 1

So the first step to embedding the font is to select Anti-alias for readability, as shown at left.

Screen capture: Dynamic fonts, Step 2

Then click the Embed button. Note that you have already selected the font family (Book Antiqua, in this case), the font weight or style (here is it Bold), and the font size. They will ALL be embedded in the font symbol you are about to create.

Screen capture: Dynamic fonts, Step 3

The Font Embedding dialog has more to it than what's shown below, but here you can see the important part: Select the Character ranges that suit your dynamic text. This is VERY important, because anything you do NOT select will show up as blanks. For example, do you have accented European characters in your text? Scroll on down to see how to get them.

Screen capture: Dynamic fonts, Step 4

Compare the number of Estimated glyphs in the illustration above with the one below. The higher this number, the larger the file size of your SWF will be. That is precisely why you should never just click "All" at the top of the list!

Screen capture: Dynamic fonts, Step 5

By checking the extra Latin sets, as shown above, you can display Latin letters that have accents, like é and ñ.

Screen capture: Dynamic fonts, Step 6

Pay attention to the Name of the font symbol you are creating. If you have a different font size in a different dynamic text field, you will have to embed that too, even though it is the same font familiy. The same goes for a different font weight (bold) or style (italic). If you need to embed three different font symbols, then you should probably name them more explicitly than "Font 3."

More Tutorials

For related tutorials, see Flash Basics: ActionScript 3.0.

License and Reuse

This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License. To attribute this work, include my name, Mindy McAdams, and a link to this page.

Contact

To contact me, please visit my home page.