We need to load in fonts at runtime due to localization needs. I've got this working in an AS3 project in Flex by embedding the font in a class and then loading that swf into another class and registering the font.
What I need now is to be able to use that font class in MXML components like a spark label. I can't seem to get it to work though. I've tried referencing the swf in a style sheet, then making a style class in the CSS using that font like this:
/* Embed.css */
Then in the MXML I have this:
<?xml version="1.0" encoding="utf-8"?>
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<s:Label text="This should display my embedded text." width="100%" styleName="genericTextArial"/>
However I can't seem to get it to render. I've also tried the method of embedding the font in a text field in Flash Professional and loading in that swf and it doesn't work either. Am I missing a parameter or just going about this the wrong way?
Try compiling the css file into a SWF and loading it via StyleManager.