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:
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.
Figure 8-4. Selecting New Font from the Library’s pop-up Options menu
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.
From the Font drop-down list, select the font that you wish to embed.
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.
Click OK in the Font Symbol Properties dialog box.
Select the new Font symbol in the Library and choose Linkage from the pop-up Options menu.
In the Linkage Properties dialog box, select the Export ...
Get Actionscript Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.