Creating and Using Font Symbols


Using fonts can add a lot to the size of a Flash movie. Before Flash 5, if you used the same font in multiple movies, that font information was included in each and every movie you created. That's a lot of redundant download time. Now Flash enables you to place fonts in a Shared Library for reuse. Information about the font doesn't get embedded in each Flash file. These fonts, called Font Symbols, can be used in multiple movies, but need only be downloaded once.

"That's great," you say. "I can finally format all my input and dynamic text to look just like I want without embedding the fonts." Not so fast. As of this writing, there's an issue with the current Flash player. It doesn't enable you to use Font Symbols for dynamic text or input text. Sorry. Don't worry, though; Macromedia is well aware of this issue and is working on it. In the meantime, you can use Font Symbols for static text. That's still a file size saver.

Note

One of the great things about Macromedia is that they are very responsive to their users, and they do their best to keep us informed about what's happening with Flash. If you're having any problems with a Flash feature, visit the Macromedia Flash Support Center at http://www.macromedia.com/support/flash. You can search the TechNotes there for more information.


Exercise 6.5 Creating a Font Symbol

Before you can share a Font Symbol, you have to create it.

  1. Create a new Flash file and save it as shared_fonts.fla.

  2. With the Library open , click the Options button in the upper-right corner of the Library window, and then choose Options > New Font.

  3. In the New Font dialog box, name the font FontA. In the Font pull-down menu, select the font you want to use as a shared font (see Figure 6.9). If you would like to be able to italicize or bold your font, make sure you check those boxes. Click OK.

    Figure 6.9. You use the New Font option and the New Font dialog box to create Font Symbols.

    graphics/06fig09.gif

    The font named FontA now appears in your Library. Notice the letter A graphic appears to the left of the name to represent an included font (see Figure 6.10). Now it's time to turn this into a Shared Library.

    Figure 6.10. Font Symbols are indicated by the letter A preceding them in the Library.

    graphics/06fig10.gif

  4. Select FontA in the Library. Right-click (Windows) or Control-click (Macintosh), and then choose Linkage.

  5. In the Linkage dialog box, select Export this symbol. In the Identifier text box, name the font FontA. Yes, this is the same name as the Font Symbol. I mean really, how many different names do you want to come up with for this one font?

  6. Click OK and save your file. Publish your movie to create the SWF file. Remember that this is a Shared Library. Close the file.

Now that you have your Font Symbol set up in a Shared Library, it's easy to use it in your files.

Exercise 6.6 Using a Shared Font

Now that you've created a shared font, using it is easy.

  1. Open a new file and save it as font_test.fla.

  2. Open shared_fonts.fla as a Shared Library.

  3. Select the FontA symbol from the shared_fonts.fla Library and drag it into the font_test.fla Library.

  4. Select the Text tool. In the Character panel (Window > Panels > Character), select FontA* (see Figure 6.11) from the Font drop-down list. The * indicates a shared font.

    Figure 6.11. Shared fonts are easy to recognize in the Character paneljust look for the fonts that have asterisks after the font name.

    graphics/06fig11.gif

  5. Place some text on the stage using the myFontA* font.

  6. Save your file as logo.fla. Choose Control>Test Movie to display the shared font.

If you want to prove to yourself that you're saving file size by using a Font Symbol in a Shared Library, all you have to do is create another file using the exact same font and text but without using a Font Symbol and Shared Library. Make sure the Bandwidth Profiler is on and test away. You will see a reduction in file size for the file using the shared font.



Inside Flash
Inside Flash MX (2nd Edition) (Inside (New Riders))
ISBN: 0735712549
EAN: 2147483647
Year: 2005
Pages: 257
Authors: Jody Keating

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net