I am porting an application from Flex 3 to 4 and I am having an issue embedding multiple fonts in a TextArea using StyleManager.
I was able to successfully embed multiple fonts directly in the css/mxml (as outlined in this post http://forums.adobe.com/thread/604156 ) however, when I extract the css for each font and compile it into its own swf, it will only render the font specifically designated by the fontFamily attribute.
Why would the fonts render perfectly when embedded in the main mxml doc, but not when loaded in via StyleManager?
private function onComplete() : void
_request = getStyleManager().loadStyleDeclarations2('Flood.swf',false);
_request.addEventListener(StyleEvent.COMPLETE, onFont1Load, false, 0, true);
private function onFont1Load(event:StyleEvent) : void
trace( 'Fruitger is loaded');
_request2 = getStyleManager().loadStyleDeclarations2('Daisy.swf',false);
_request2.addEventListener(StyleEvent.COMPLETE, onFont2Load, false, 0, true);
private function onFont2Load(event:StyleEvent) : void
trace( 'Daisy is loaded');
private function onFontLoad():void
var tf : String = '<P><FONT FACE="Flood" SIZE="26" COLOR="#000000">This is a nice piece of text in Flood</FONT></P>' +
'<P><FONT FACE="Daisy" SIZE="23" COLOR="#FF0000">This is a nice piece of text in Daisy</FONT></P>';
myTextArea.textFlow = TextConverter.importToFlow(tf, TextConverter.TEXT_FIELD_HTML_FORMAT);
public static function getStyleManager():IStyleManager2
Thanks in advance!
I've been having this same issue.. it seems that the behavior is different with the runtime fonts.
Please post some code if you figure it out!
looks like it is a bug... it was working in Beta2 but broken in Release... I created and compiled two sample applications (and runtime fonts)
please vote for the bug to help get this fixed.. looks like a few people have been running into this same issue..