Flash CS3 Documentation |
|||
| Learning ActionScript 2.0 in Adobe Flash > Working with Text and Strings > Using fonts > Embedding fonts | |||
When you embed fonts, Flash stores all of the font information in the SWF file so the font is displayed properly even if it's not installed on the user's computer. If you use a font in your FLA file that isn't installed on a user's system, and you don't embed the font in the SWF file, Flash Player automatically selects a substitute font to use instead.
|
NOTE |
|
You need to embed a font only if you're using dynamic or input text fields. If you use a static text field, you don't need to embed the font. |
Open the library that you want to add the font symbol to.
Your font now appears in the current document's library.
After you've embedded a font in your library, you can use it with a text field on the Stage.
Embedded fonts have an asterisk (*) after the font name.
The Character Embedding dialog box lets you select the individual characters or character sets that you want to embed for the selected text field. To specify what characters to embed, either type the characters into the text box in the dialog box, or click Auto Fill to automatically populate the text field with the unique characters currently in the text field. If you aren't sure which characters you will need (for example, because your text loads from an external file or a web service), you can select entire sets of characters to embed, such as Uppercase [A..Z], Lowercase [a..z], Numerals [0..9], Punctuation [!@#%...], and character sets for several different languages.
|
NOTE |
|
Each character set you select increases the final size of the SWF file because Flash has to store all of the font information for each character set that you use. |
The embedded font is displayed in the text field on the Stage. To properly test that the font is embedded, you might need to test on a separate computer without the embedded font installed.
Or you can set the TextField._alpha or TextField._rotation properties for the text field with embedded fonts, because these properties work only on embedded fonts (see the following steps).
font_txt._rotation = 45;
The embedded font rotates 45ยบ clockwise, and you can still see the text because it's embedded in the SWF file.
|
CAUTION |
|
If you don't embed a font within your Flash document and Flash Player automatically chooses a font substitute on the user's computer, the TextField.font property returns the original font used within the FLA, not the name of the substituted font. |
|
NOTE |
|
If you use embedded fonts with a variety of styles in your text fields, you must embed the style that you want to use. For example, if you're using an embedded font called Times, and then want a word to be italic, you must make sure to embed both the normal and italic character outlines. Otherwise, the text won't appear in the text field. |
Flash CS3
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00000893.html
Comments
Xak_tre said on Feb 25, 2008 at 7:57 AM :