View comments | RSS feed

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.

To embed a font symbol:

  1. Select Window > Library to open the current FLA file's library.

    Open the library that you want to add the font symbol to.

  2. Select New Font from the library's pop-up menu (upper-right corner of the Library panel).
  3. Type a name for the font symbol in the Name text box of the Font Symbol Properties dialog box.
  4. Select a font from the Font menu or type the name of a font in the Font text box.
  5. Select Bold, Italic, or Alias text if you want to apply a style to the font.
  6. Enter the font size to embed, and then click OK to apply the changes and return to your document.

    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.

To use an embedded font symbol in your Flash document:

  1. Follow the steps in the procedure under Embedding fonts to embed a font in your library.
  2. Use the Text tool to create a text field on the Stage.
  3. Type some text in the text field.
  4. Select the text field, and open the Property inspector.
    1. Set the text field to single-line.
    2. Select the name of the embedded font by using the Font drop-down menu.

    Embedded fonts have an asterisk (*) after the font name.

  5. Click Embed in the Property inspector to launch the Character Embedding dialog box.

    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.

  6. Select the individual characters or character sets you want to embed, and then click OK to apply the changes and return to your document.
  7. Select Control > Test Movie to test the Flash document in the authoring environment.

    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).

  8. Close the SWF file and return to the authoring tool.
  9. Select the text field on the Stage, and open the Property inspector.
    1. Set the text field's Text type to Dynamic Text.
    2. Type font_txt into the Instance Name text box.
  10. Add the following code to Frame 1 of the Timeline:
    font_txt._rotation = 45;
    
  11. Select Control > Test Movie again to view the changes in the authoring environment.

    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


Comments


Xak_tre said on Feb 25, 2008 at 7:57 AM :
Ha ha ha try again, if you embed the font in an input field following these instructions your input field disapears rendering it worthless. Why didn't you just keep the ORIGINAL schema for embedding fonts that one really worked.

 

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