Embedding fonts in Flex 4

In Flex 3 I created a component where I needed to embed the fonts. I did so with:

[Embed(source='assets/fonts/ARIALBD.TTF', fontName='tabfont', fontWeight='bold')]

Until Flex 4 halo components use Flash Player 10 FTE based text (remembering that FTE is only compatible with CFF embedded fonts), you’ll have to also specify embedAsCFF=’false’ because the legacy Flash Player TextField based text cannot use CFF embedded fonts.

Additionally Spark skins for halo components now use the plain font instead of bold.

So now, to do the same in Flex 4, it’s:

[Embed(source='assets/fonts/ARIAL.TTF', embedAsCFF='false', fontName='tabfont')]

Post to Twitter


5 Responses to “Embedding fonts in Flex 4”

Leave a Reply