O'Reilly logo

Actionscript Cookbook by Joey Lott

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

8.20. Embedding Fonts

Problem

You want to ensure that text will display properly even if the intended font is not installed on the user’s computer.

Solution

Export the font in the movie’s Library, set the text field’s embedFonts property to true, and use a TextFormat object, setting its font property to the linkage identifier for the embedded font.

Discussion

You should embed fonts if you want to ensure that text will display using the intended font even if the font is not installed on the user’s computer. To embed a font, follow these steps:

  1. Open the Flash document’s Library and select New Font from the pop-up Options menu (see Figure 8-4). A Font Symbol Properties dialog box appears.

    Selecting New Font from the Library’s pop-up Options menu

    Figure 8-4. Selecting New Font from the Library’s pop-up Options menu

  2. In the Name field, specify the name given to the symbol in the Library. Any name will suffice, so specify a name that makes sense to you.

  3. From the Font drop-down list, select the font that you wish to embed.

  4. If you wish to include the bold and/or italic versions of the font as well, select the appropriate checkboxes. Be aware that including bold and italic font outlines will increase the file size significantly, so do so only if you really need them.

  5. Click OK in the Font Symbol Properties dialog box.

  6. Select the new Font symbol in the Library and choose Linkage from the pop-up Options menu.

  7. In the Linkage Properties dialog box, select the Export ...

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