Updated: January 20th, 2010

Archive for January, 2010

A property list for embedding fonts with the [Emded] metadata tag.

iconJanuary 20th, 2010 icon5 Comments

The purpose of this post is to document all the different properties available when using the [Embed] metadata tag to embed fonts into an SWF file. Much of this information is spread throughout Adobe’s documentation, and some of it came from personal experience while developing the Runtime Font Publisher extension. This list was generated out of a desire to see all this information in a single easy-to-read table.

While researching this post the most important points I discovered are that the Flex SDK uses three different font managers, that the font type (OpenType versus TrueType) often impacts the behavior of a property, and in a few cases, setting a value on one property will affect the behavior of a different property. As such I’ve repeated properties to point out behaviors specific to font type, and the notes point out instances where setting one property affects the behavior of a different property. Enjoy!

Font Type Property Values Notes
OpenType not supported TrueType systemFont Exact name of a system font
(e.g., "Arial")
The font must be installed on your system. The JRE font manager is used to embed system fonts. The Flex SDK does not support embedding OpenType sytem fonts.
OpenType source Absolute or relative location of font file (e.g., "c:/akbar.otf") OpenType fonts are transcoded by the AFE font manager.
TrueType source Absolute or relative location of font file (e.g., "../akbar.ttf") TrueType fonts can be transcoded by the AFE or Batik font manager. Modifying the flex-config.xml file defines which font manager is used.
OpenType TrueType fontName String alias The fontName property is used to reference the font at runtime within the Flash Player. To shadow a font, that is giving it the same name as a system font, set the show-shadows-system-font-warnings compiler option to false. Shadowing a font often causes issues at runtime, especially if the system font that is being shadowed has a different weight or style than the embedded font.
OpenType TrueType fontFamily String alias Exhibits the same behavior as the fontName property.
OpenType fontWeight normal | bold | heavy The fontWeight property must be set to the typeface style defined by the font file. Adobe’s documentation only references the three values, however some font files have a different typeface style. In theory, these could also be used. Have yet to test.
TrueType fontWeight normal | bold | heavy The fontWeight property behaves the same for TrueType fonts as OpenType font when using the source property to embed a font. When the systemFont property is used, the font can be set to either normal or bold. I believe this styling is done by functions of the compiler, and not the exact font outlines defined in the font file. Must research more.
OpenType fontStyle normal | italic | oblique The fontStyle property must be set to the typeface style defined by the font file. Adobe’s documentation only references the three values, however some font files have a different typeface style. In theory, these could also be used. Have yet to test.
TrueType fontStyle normal | italic | oblique The fontStyle property behaves the same for TrueType fonts as OpenType font when using the source property to embed a font. When the systemFont property is used, the font can be set to either normal or italic. I believe this styling is done by modifying the outlines for the font, and not using the exact outlines defined within the font file. Must research more.
OpenType TrueType unicodeRange Unicode characters written in U+hex notation. Also accepts string range names. Ranges are specificed by dashes. Characters and ranges are comma delimited. String range names are defined in flex-config.xml.
OpenType TrueType advanced-
AntiAliasing
true | false By default the Flex SDK sets this value to true. Fonts that use advanced anti-aliasing appear sharper at smaller sizes. This property is ignored if the cff property is set to true.
OpenType TrueType cff embedAsCFF true | false Compact Font Format embedded fonts are created when set to true. CFF fonts are used by the Flash Text Engine. Classic textfields (flash.text.textfield) cannot use embedded CFF fonts.
OpenType mimeType application/x-font This property must be set to succesfully embed the font.
TrueType mimeType application/x-font | application/x-font-truetype Unknown if using either mimeType affects behavior of embedded font.

The Author

Johannes Tacskovics
ECMAScript Developer

Portrait of Johannes Tacskovics

On front-end software engineering this is the blog of Johannes Tacskovics, a Los Angeles based ECMAScript Developer. This blog is focused on object oriented software development for the web.

Article Categories

Article Archives

Meta