|
Flash CS4 Resources |
About multilanguage textContents [Hide]You can configure a FLA file to display text in different languages depending on the language of the operating system that plays the Flash content. Multilanguage text in FlashYou can include multilanguage text in your document in the following ways:
For a sample of multilingual content, see the Flash Samples page at www.adobe.com/go/learn_fl_samples. Download and decompress the Samples zip file and navigate to the Text\MultilingualContent folder to access the sample. About fonts for Unicode-encoded textWhen you use external files that are Unicode encoded, your users must have access to fonts containing all the glyphs used in your text files. By default, Flash stores the names of fonts used in dynamic or input text files. During SWF file playback, Flash Player 7 (and earlier versions) looks for those fonts on the operating system running the player. If the text in a SWF file contains glyphs that the specified font does not support, both Flash Player 7 and Flash Player 8 attempt to locate a font on the user’s system that supports those glyphs. The player cannot always locate an appropriate font. This behavior depends on the fonts available on the user’s system, as well as on the operating system running Flash Player. Embed fonts for dynamic or input text fieldsFor dynamic or input text fields, embed fonts. However, some fonts, particularly those used for Asian languages, can add significantly to the SWF file size when embedded. With Flash, you can select ranges of fonts to embed. You can also embed fonts by creating a font symbol in the library. Select and embed a range of fonts
Note: Select
only the font sets to embed, so you do not exceed the internal maximum number
of glyphs for the authoring tool (approximately 65.500). Flash does not perform error-checking
to confirm that the selected character set contains glyphs. During
the publish or export procedure, only glyphs that are present in
the font are embedded in the SWF file.
Embed font sets from text on the Stage
Remove embedded font sets
XML font embedding tableWhen you select ranges of fonts to embed in a FLA file, Flash uses the UnicodeTable.xml file to determine which characters to embed. The UnicodeTable.xml file contains ranges of characters required for various languages and resides in the user configuration folder of your computer. The is located in the following directories:
The font set groupings are based on the Unicode Blocks as defined by the Unicode Consortium. To provide a simpler workflow, when you select a particular language, all related glyph ranges are embedded even if they are scattered into disjointed groupings. For example, if you select Korean, the following Unicode character ranges are embedded: 3131‑318E Hangul symbols 3200‑321C Hangul specials 3260‑327B Hangul specials 327F‑327F Korean symbol AC00‑D7A3 Hangul symbols If you select Korean + CJK, a larger font set is embedded: 3131‑318E Hangul symbols 3200‑321C Hangul specials 3260‑327B Hangul specials 327F‑327F Korean symbol 4E00‑9FA5 CJK symbols AC00‑D7A3 Hangul symbols F900‑FA2D CJK symbols The following table gives more details about the font selections for embedded fonts:
Non-Unicode external filesIf you load external text or XML files that are not Unicode-encoded into a Flash Player 7 application, the text in the external files does not appear correctly when Flash Player attempts to show them as Unicode. To tell Flash Player to use the traditional code page of the operating system that is running the player, add the following code as the first line of code in the first frame of the Flash application that is loading the data: system.useCodepage = true; Set the system.useCodepage property only once in a document; do not use it multiple times in a document to make the player interpret some external files as Unicode and some as other encoding, because this can yield unexpected results. If you set the system.useCodepage property to true, the traditional code page of the operating system running the player must include the glyphs used in your external text file for the text to appear. For example, if you load an external text file that contains Chinese characters, those characters do not appear on a system that uses the CP1252 code page, because that code page does not include Chinese characters. To ensure that users on all platforms can view external text files used in your Flash applications, encode all external text files as Unicode and leave the system.useCodepage property set to false by default. This causes Flash Player to interpret the text as Unicode. For more information, see useCodepage (System.useCodepage property) in the ActionScript 2.0 Language Reference. Text encodingAll text in a computer is encoded as a series of bytes. Many different forms of encoding (and therefore, different bytes) represent text. Different kinds of operating systems use different kinds of encoding for text. For example, Western Windows operating systems usually use CP1252 encoding; Western Macintosh operating systems usually use MacRoman encoding; Japanese Windows and Macintosh systems usually use Unicode encoding. Unicode can encode most languages and characters used throughout the world. The other forms of text encoding that computers use are subsets of the Unicode format, tailored to specific regions of the world. Some of these forms are compatible in some areas and incompatible in other areas, so using the correct encoding is critical. Unicode has several forms. Flash Player versions 6 and 7 and later support text or external files in the 8‑bit Unicode format UTF‑8, and in the 16‑bit Unicode formats UTF‑16 BE (Big Endian) and UTF‑16 LE (Little Endian). Unicode and Flash PlayerFlash Player 6 and later versions support Unicode text encoding. Users with Flash Player 6 or later can view multilanguage text, regardless of the language that the operating system running the player uses, if they have the correct fonts installed. Flash Player assumes that all external text files associated with a Flash Player application are Unicode encoded, unless you tell the player otherwise. For Flash applications in Flash Player 5 or earlier that are authored in Flash MX or earlier, Flash Player 6 and earlier versions display the text by using the traditional code page of the operating system running the player. For background information on Unicode, see Unicode.org. Text encoding in Flash PlayerBy default, Flash Player 7 and later assumes that all text it encounters is Unicode encoded. If your document loads external text or XML files, the text in these files should be UTF‑8 encoded. Create these files by using the Strings panel or using a text or HTML editor that can save the files in Unicode format. Unicode encoding formats that Flash Player supportsWhen reading text data in Flash, Flash Player looks at the first two bytes in the file to detect a byte order mark (BOM), a standard formatting convention used to identify the Unicode encoding format. If no BOM is detected, the text encoding is interpreted as UTF‑8 (an 8‑bit encoding format). It is recommended that you use UTF‑8 encoding in your applications. If Flash Player detects either of the following BOMs, the text encoding format is interpreted as follows:
Encoding in external XML filesYou cannot change the encoding of an XML file by changing the encoding tag. Flash Player identifies the encoding of an external XML file using the same rules as for all external files. If no BOM is encountered at the beginning of the file, the file is assumed to be in UTF‑8 encoding. If a BOM is encountered, the file is interpreted as UTF‑16BE or LE. |