2
votes

I'm testing some font embedding in Flex 4. Using the tutorial below (modified a bit), I'm loading in fonts via compiling CSS into SWFs.

http://www.softwarebyrichard.com/content/embedding-fonts-flex-4

When I apply those styles to my Flex components all is well, however, I need to add an AS3 component to my Flex app. This component has some Flash text fields in it. The only way I know to embed fonts in AS3 is completely different and I believe requires another load. What I want to know is if there is any way that the text fields in my AS3 component can use the same styles and embedded fonts that the Flex components are using. This would make my life a whole lot easier (and my app smaller I believe). Thanks.

1
Check the Font.enumerateFonts() method, and see if your Flex font shows up there.meddlingwithfire
Thanks. The Flex fonts are indeed there... the problem is that I need to use embedAsCFF = true to get them to work in the Spark components, and those won't work with the text fields. Does anyone know of a way I can use them without having to import them twice?budkin
Unfortunately I ended up having to embed them twice due to the differences between the font formats. What I can't figure out now is how to actually assign those fonts (loaded by StyleManager via css/tff compiled as SWF) to the TextFields in my AS3 component.budkin

1 Answers

0
votes

Sadly, I don't think this is possible. StyleManager encodes fonts in its own ecosystem which is not compatible with Flash embedded font system. However, the reverse should be possible. You should be able to embed fonts in Flash and use their font references in your Flex application. See the below article on the step-by-step details:

http://livedocs.adobe.com/flex/3/html/help.html?content=fonts_09.html