It should work, but depending on which class is going to display the text, you 
might also need to use ContextualClassFactory and/or package those classes into 
the same modules as the fonts.  See other posts by me on embedded fonts.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: [email protected] [mailto:[email protected]] On Behalf 
Of rid_b80
Sent: Wednesday, May 20, 2009 7:04 PM
To: [email protected]
Subject: [flexcoders] Re: Embedding fonts dynamically...





I've tried this and it doesnt seems to unload the previous fonts

Is anyone having that problem as well?

--- In [email protected]<mailto:flexcoders%40yahoogroups.com>, 
"Wildbore, Brendon" <b.j.wildb...@...> wrote:
>
> Hi,
>
> One way of achieving this is two have a number of different stylesheets with 
> the embedded fonts in them.
> Use the stylemanager class to change the stylesheet to display the font you 
> would like.
>
> Eg.
>
> var oldStyleFile:String = "/css/basicfont.swf";
>
> try{
> StyleManager.unloadStyleDeclarations(oldStyleFile);
> }catch(err:Error){trace("error removing oldStyleFile style");}
>
> //add new theme
> var newStyleFile:String = "/css/funkyfont.swf";
>
> try{
> StyleManager.loadStyleDeclarations(newStyleFile);
> }catch(err:Error){trace("error loading newStyleFile style");}
>
>
> Hope this helps
>
>
>
> ________________________________
> From: [email protected]<mailto:flexcoders%40yahoogroups.com> 
> [mailto:[email protected]<mailto:flexcoders%40yahoogroups.com>] On 
> Behalf Of tchredeemed
> Sent: Thursday, 4 December 2008 7:37 a.m.
> To: [email protected]<mailto:flexcoders%40yahoogroups.com>
> Subject: [flexcoders] Re: Embedding fonts dynamically...
>
>
> How would I do that?
>
> Also, do you know of any way to tell if the user has a font already,
> and I will only embed it if they need it (don't want to load a font
> that they already have...)
>

Reply via email to