RE: [flexcoders] Re: Embedding fonts dynamically...
You shouldn't need to unregister. We use weak references. I'm guessing that something else is preventing the module from unloading. Try using the profiler and see what is holding onto the module Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of rid_b80 Sent: Thursday, May 21, 2009 8:13 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Embedding fonts dynamically... Yes, I'm left the applicationDomain parameter to default. i'm jut wondering is there any information to do what's mentioned below. Using Flex to create the font swfs and is it possible to unregister font using the embeededFontregistry. Thanks, you help is much appreciated --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Alex Harui aha...@... wrote: Not if the fonts get registered with registerFont. If you use Flex to create the font swfs you shouldn't need to call registerFont, but they may not show up in enumerateFonts. However they should get registered with the embeddedFontRegistry and work properly. I assume you showed the exact call to loadStyleDeclarations and aren't messing with the applicationDomain parameter? Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of rid_b80 Sent: Thursday, May 21, 2009 1:26 AM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Embedding fonts dynamically... I guess what i'm trying to do is this when i call like StyleManager.loadStyleDeclarations(css/font1.swf); StyleManager.loadStyleDeclarations(css/font2.swf); and i call var fontList:array = Font.enumerateFonts(false); my fontList will be something like (font1,font2) Then when i go StyleManager.unloadStyleDeclarations(css/font1.swf); StyleManager.unloadStyleDeclarations(css/font2.swf); StyleManager.loadStyleDeclarations(css/font3.swf); StyleManager.loadStyleDeclarations(css/font4.swf); then var fontList:array = Font.enumerateFonts(false); my fontList is (font1,font2,font3,font4) not just (font3 and font4) I'm just wondering if there is anyway to do that Thanks --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com, Alex Harui aharui@ wrote: 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: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of rid_b80 Sent: Wednesday, May 20, 2009 7:04 PM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com 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 flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com, Wildbore, Brendon B.J.Wildbore@ 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: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of tchredeemed Sent: Thursday, 4 December 2008 7:37 a.m. To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Embedding fonts dynamically... How would I do that? Also, do you
[flexcoders] Re: Embedding fonts dynamically...
I guess what i'm trying to do is this when i call like StyleManager.loadStyleDeclarations(css/font1.swf); StyleManager.loadStyleDeclarations(css/font2.swf); and i call var fontList:array = Font.enumerateFonts(false); my fontList will be something like (font1,font2) Then when i go StyleManager.unloadStyleDeclarations(css/font1.swf); StyleManager.unloadStyleDeclarations(css/font2.swf); StyleManager.loadStyleDeclarations(css/font3.swf); StyleManager.loadStyleDeclarations(css/font4.swf); then var fontList:array = Font.enumerateFonts(false); my fontList is (font1,font2,font3,font4) not just (font3 and font4) I'm just wondering if there is anyway to do that Thanks --- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote: 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: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of rid_b80 Sent: Wednesday, May 20, 2009 7:04 PM To: flexcoders@yahoogroups.com 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 flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Wildbore, Brendon B.J.Wildbore@ 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: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of tchredeemed Sent: Thursday, 4 December 2008 7:37 a.m. To: flexcoders@yahoogroups.commailto: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...)
RE: [flexcoders] Re: Embedding fonts dynamically...
Not if the fonts get registered with registerFont. If you use Flex to create the font swfs you shouldn't need to call registerFont, but they may not show up in enumerateFonts. However they should get registered with the embeddedFontRegistry and work properly. I assume you showed the exact call to loadStyleDeclarations and aren't messing with the applicationDomain parameter? Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of rid_b80 Sent: Thursday, May 21, 2009 1:26 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Embedding fonts dynamically... I guess what i'm trying to do is this when i call like StyleManager.loadStyleDeclarations(css/font1.swf); StyleManager.loadStyleDeclarations(css/font2.swf); and i call var fontList:array = Font.enumerateFonts(false); my fontList will be something like (font1,font2) Then when i go StyleManager.unloadStyleDeclarations(css/font1.swf); StyleManager.unloadStyleDeclarations(css/font2.swf); StyleManager.loadStyleDeclarations(css/font3.swf); StyleManager.loadStyleDeclarations(css/font4.swf); then var fontList:array = Font.enumerateFonts(false); my fontList is (font1,font2,font3,font4) not just (font3 and font4) I'm just wondering if there is anyway to do that Thanks --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Alex Harui aha...@... wrote: 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: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of rid_b80 Sent: Wednesday, May 20, 2009 7:04 PM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 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 flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com, Wildbore, Brendon B.J.Wildbore@ 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: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of tchredeemed Sent: Thursday, 4 December 2008 7:37 a.m. To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto: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...)
[flexcoders] Re: Embedding fonts dynamically...
Yes, I'm left the applicationDomain parameter to default. i'm jut wondering is there any information to do what's mentioned below. Using Flex to create the font swfs and is it possible to unregister font using the embeededFontregistry. Thanks, you help is much appreciated --- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote: Not if the fonts get registered with registerFont. If you use Flex to create the font swfs you shouldn't need to call registerFont, but they may not show up in enumerateFonts. However they should get registered with the embeddedFontRegistry and work properly. I assume you showed the exact call to loadStyleDeclarations and aren't messing with the applicationDomain parameter? Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of rid_b80 Sent: Thursday, May 21, 2009 1:26 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Embedding fonts dynamically... I guess what i'm trying to do is this when i call like StyleManager.loadStyleDeclarations(css/font1.swf); StyleManager.loadStyleDeclarations(css/font2.swf); and i call var fontList:array = Font.enumerateFonts(false); my fontList will be something like (font1,font2) Then when i go StyleManager.unloadStyleDeclarations(css/font1.swf); StyleManager.unloadStyleDeclarations(css/font2.swf); StyleManager.loadStyleDeclarations(css/font3.swf); StyleManager.loadStyleDeclarations(css/font4.swf); then var fontList:array = Font.enumerateFonts(false); my fontList is (font1,font2,font3,font4) not just (font3 and font4) I'm just wondering if there is anyway to do that Thanks --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Alex Harui aharui@ wrote: 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: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of rid_b80 Sent: Wednesday, May 20, 2009 7:04 PM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 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 flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com, Wildbore, Brendon B.J.Wildbore@ 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: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of tchredeemed Sent: Thursday, 4 December 2008 7:37 a.m. To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto: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...)
[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 flexcoders@yahoogroups.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: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of tchredeemed Sent: Thursday, 4 December 2008 7:37 a.m. To: flexcoders@yahoogroups.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...)
RE: [flexcoders] Re: Embedding fonts dynamically...
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: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of rid_b80 Sent: Wednesday, May 20, 2009 7:04 PM To: flexcoders@yahoogroups.com 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 flexcoders@yahoogroups.commailto: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: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of tchredeemed Sent: Thursday, 4 December 2008 7:37 a.m. To: flexcoders@yahoogroups.commailto: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...)
RE: [flexcoders] Re: Embedding fonts dynamically...
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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of tchredeemed Sent: Thursday, 4 December 2008 7:37 a.m. To: flexcoders@yahoogroups.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...)
[flexcoders] Re: Embedding fonts dynamically...
Will this allow me to actually embed fonts dynamically? or to just use fonts that I have already embedded?
[flexcoders] Re: Embedding fonts dynamically...
--- In flexcoders@yahoogroups.com, tchredeemed [EMAIL PROTECTED] wrote: Will this allow me to actually embed fonts dynamically? or to just use fonts that I have already embedded? The whole idea that you could embed a font that isn't compiled into the file at compile time doesn't make any sense. The font has to be compiled into a swf or swc file for it to be embedded at all. You can't go back later after it's compiled and compile in more or fewer fonts. HTH; Amy
[flexcoders] Re: Embedding fonts dynamically...
I am concerned about the filesize if we embed all files. I think what Alex said might work, we could embed the font into a module, and only load a module as we need the font.
[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...)
RE: [flexcoders] Re: Embedding fonts dynamically...
Start by putting a font in a module. You can use the Font class to see what's already there From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of tchredeemed Sent: Wednesday, December 03, 2008 10:37 AM To: flexcoders@yahoogroups.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...)