402
Working with Text and Strings
The embedded font rotates 45º clockwise, and you can still see the text because it’s
embedded in the SWF file.
Creating custom character sets
In addition to using the Flash default character sets, you can also create your own character
sets and add them to the Character Embedding dialog box. For example, you might need to
allow some fields to include Extended Latin, to support various accented characters. However,
perhaps you don’t need the numerals and punctuation, or perhaps you only need uppercase
characters. Rather than embedding entire character sets, you can create a custom character set
that contains only the characters that you need. This way you can keep the size of your SWF
file as small as possible, because you don’t store any extra font information for the characters
that you don’t need.
To create a custom character set, you must edit the UnicodeTable.xml file, located in the
C:\Program Files\Macromedia\Flash 8\
<language>
\First Run\FontEmbedding\ directory.
This file defines the default character sets and the character ranges and characters that
they contain.
Before you create a custom character set, you should understand the necessary XML structure.
The following XML nodes define the Uppercase [A..Z] character set:
<glyphRange name="Uppercase [A..Z] " id="1" >
<range min="0x0020" max ="0x0020" />
<range min="0x0041" max ="0x005A" />
</glyphRange>
Notice that the
glyphRange
node includes
name
,
Uppercase [A..Z]
, and
id
. A
glyphRange
node can have as many
range
child nodes as you need. A range can be a single character, such
as
0x0020
(the space character), seen in the previous snippet, or a range of characters, such as
the second range child node. To embed only a single character, set the
min
value and the
max
value to the same unicode character value.
CAU
T
IO
N
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.
NO
TE
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.
Summary of Contents for FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Page 1: ...Learning ActionScript 2 0 in Flash...
Page 8: ...8 Contents...
Page 18: ...18 Introduction...
Page 30: ...30 What s New in Flash 8 ActionScript...
Page 66: ...66 Writing and Editing ActionScript 2 0...
Page 328: ...328 Interfaces...
Page 350: ...350 Handling Events...
Page 590: ...590 Creating Interaction with ActionScript...
Page 710: ...710 Understanding Security...
Page 730: ...730 Debugging Applications...
Page 780: ...780 Deprecated Flash 4 operators...
Page 830: ...830 Index...