To ensure that the fonts are properly embedded, try rotating the controls that use the fonts. You can view rotated fonts only if they are embedded, so if the text disappears when you rotate the control, the font is not properly embedded.
To properly embed your fonts, try the following techniques:
- If one type of control is not correctly displaying its text, ensure that you are embedding the appropriate typeface. For example, the Button control's text labels require the bold typeface. If you do not embed the bold typeface, the Button control does not display the embedded font.
- In your Flex application, ensure that you set all properties for each font typeface in the @font-face declaration or [Embed] statement. To embed a bold typeface, you must set the fontWeight property to bold, as the following example shows:
@font-face {
src: url(../assets/MyriadWebProEmbed.ttf);
fontFamily: "Myriad Web Pro";
fontWeight: bold;
}
You also must set the fontWeight style property in your style definition:
.myStyle2 {
fontFamily:"Myriad Web Pro";
fontWeight:bold;
fontSize:12pt;
}
If you use the [Embed] statement, you must set the fontWeight property to bold as the following example shows:
[Embed(source="MyriadWebProEmbed.ttf", fontName="Myriad Web Pro",fontWeight="bold")]
- For fonts in SWF files, open the FLA file in Flash and ensure that all of the typefaces were added properly. Select each text area and do the following:
- Check that the font name is correct. Ensure that the spelling and word spacing of the font name in the list of available fonts in Flash is the same as the fontFamily property in the @font-face declaration or the fontName property in your [Embed] statement. This value must also match the fontFamily property that you use in your style definitions.
If you did not select an anti-aliasing option for the font in Flash 8 (for example, you chose Bitmap Text (no anti-alias)), you might need to change the value of the font name to a format that matches fontName_fontSizept_st (for example, "Wingdings_8pt_st"). In the CSS for that bitmap font, be sure to set fontAntiAliasType to normal.
To determine the exact font name exported by Flash (which you must match as the value of the fontFamily property in your Flex application), open the SWF file in Flash 8 and select Debug > Variables.
- Check that the style is properly applied. For example, select the bold text area and check that the typeface really is bold.
- Click the Embed button and ensure that the range of embedded characters includes the characters that you use in your Flex application.
- Check that each text area is set to Dynamic Text and not Static Text or Input Text. The type of text is indicated by the first drop-down box in the text's Properties tab.
- For fonts in SWF files, ensure that you are using the latest SWF file that contains your fonts and was generated in Flash. Regenerate the SWF file in Flash if necessary.