I have a 3 part series on Changing embedded True Type fonts at Runtime in Flex Applications which you might find useful.
It demonstrates loading swfs that contain embedded fonts and applying them to the app via: 1. Using loader: http://blog.739saintlouis.com/2007/02/12/changing-embedded-true-type-fon ts-at-runtime-in-flex-applications/ 2. Using modules: http://blog.739saintlouis.com/2007/02/23/using-modules-to-change-embedde d-true-type-fonts-at-runtime-in-flex-applications/ 3. Using Runtime CSS: http://blog.739saintlouis.com/2007/02/23/using-runtime-css-to-change-emb edded-true-type-fonts-at-runtime-in-flex-applications/ -Kyle ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alex Harui Sent: Thursday, March 08, 2007 7:22 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Modules at 360Flex conference Actually Roger, our friend Paul made possible a fourth solution, which seems pretty good, which is to use Runtime CSS, as suggested by the previous email. Runtime CSS generates the appropriate Font.registerFont calls for you and you get to use CSS syntax, which is cool. It is basically automation of (2). It does mean that all modules using a particular font name must use that one shared font definition, so subsetting characters would be a dangerous thing to do, but I think it'll work for most people. I packaged up an example and posted it on my blog at http://blogs.adobe.com/aharui/presentations/ <http://blogs.adobe.com/aharui/presentations/> I think I'm actually supposed to be working on something else, so I won't be taking on a best practice for binding in unloadable modules right now. -Alex ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Roger Gonzalez Sent: Thursday, March 08, 2007 4:07 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Modules at 360Flex conference There are basically three solutions right now. Brute force hammer solutions: 1) Embed the font everywhere in all SWFs, so that there is never any confusion about where to find the font, because its everywhere. 2) Use Font.registerFont to globally register a particular font name across all SWF boundaries forever. Complicated solution that I tried to automate but it was just too weird: 3) Guarantee that whenever you create a TextField using a font that the code creating the TextField is located in the same SWF as the font. You'd think that "3" sounds doable, until you mix in the fact that if it is utility code, it cannot be code that is shared between a parent SWF and a client SWF, because the parent's version of the code will get used and it will look in the wrong SWF context. Basically, after wrasslin' with 3 for a while (by replacing all instances of "new TextField()" with a getter to a per-SWF-unique class factory hooked off of CSS blobs that almost worked until I hit the PopupManager case), my head asplode. -rg ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of - FI / Jonas Eliasson + Sent: Thursday, March 08, 2007 3:54 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Modules at 360Flex conference Regarding the embedded font issue: We have following solution which seems to work well. It's also a similar solution we have used on Flash 7 and 8. Embed the fonts into a SWF (Flash 8 or 9) both work with Flex. Basically put them in a clip on the stage in the Flash IDE. Lets call it fonts.swf. Then you create a CSS with following tags @font-face { src:url("../fonts/fonts.swf") ; fontFamily: "DIN Neuzeit Grotesk Std Bold Cn" ; } .MainHeading { fontFamily: "DIN Neuzeit Grotesk Std Bold Cn" ; fontSize: 22px ; color: #55852A ; } Now you use FlexBuilder and compile the CSS into a SWF. Then use the StyleManager to reference and load the generated css SWF Then you could do [UIComponent].styleName = ".MainHeading" ; Hope that helps, I might be behind you guys but this has worked on a couple of tests we have done. I guess the font.swf will still be loaded from each module using it but it will be returned from the browser cache. Not sure if Adobe have some internal caching on these loaders. Cheers, Jonas ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Bjorn Schultheiss Sent: den 8 mars 2007 17:13 To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Modules at 360Flex conference RG, 1 & 2 & 3 are both linked. 200 kb for a shell plus another 600 kb for RSL's in the initial download is too nasty. What i need is modularization of the framework so that it can 'broken up', a cairngorm framework that supports a Model that is suited for module development, and an alternative to databinding that doesn't break each time a module is set to invisible or unloaded. Not being able to use embedded fonts is also painful. This is not a module bashing email by the way. This is just a perspective of the the pain i've been through. Bjorn On 09/03/2007, at 5:17 AM, Roger Gonzalez wrote: What is the issue with "smaller swf output file sizes"? If you use link-report and load-externs, you can optimize swf size for both the modules and the main app without any issues. Just out of curiosity, have you filed any bugs regarding the other issues you've encountered? (Cross-SWF font access is a problem at the player level, but the other stuff is all fixable.) -rg ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Bjorn Schultheiss Sent: Wednesday, March 07, 2007 7:00 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Modules at 360Flex conference Shaun, Smaller Swf output file sizes, Module support within the mx framework, Module support within Cairngorm, Issues with Viewstacks and Binding, Embedding Fonts, I think there are a couple more as well. Bjorn On 08/03/2007, at 1:11 PM, shaun wrote: Bjorn Schultheiss wrote: > Hey Alex, > > After your experience with modules do you believe it was the correct > decision to include it in 2.01 as opposed to waiting for 3.0? ! > Over here we just refactored away from modules to the mon! olithic ria > because of outstanding issues.. > What are the outstanding issues? cheers, - shaun