Hello All,

I've run into a confusing issue:

I've created several font SWFs that contain only the characters that I need for a particular language and I was loading them in using a FontLoader class that I pass a "language" parameter to. After the FontLoader class loads the proper font (Event.COMPLETE), It calls a method that had Font.registerFont in it, to add it to the list of available fonts.

This was working perfectly until the client threw a wrench into the gears. I now have to have the font files on a different server because the CMS that they're using only allows them to upload a single SWF into the page (no assets are allowed). I added the proper Security.allowDomain stuff and I know the fonts are loading because they trace out, but now when I try to register the font, I get this error:

ArgumentError: Error #1508: The value specified for argument font is invalid.
        at flash.text::Font$/registerFont()
        at com.johnsoncontrols.bsrbanner.utils::FontLoader/registerFont()


Here's my registerFont method that used to work:

                private function registerFont(e:Event):void
                {
var FontLibrary:Class = e.target.applicationDomain.getDefinition ("ArialUnicode_" + _language);
                        
                         Font.registerFont(FontLibrary["ArialUnicode_" + 
_language]);

                         _loadedFont = FontLibrary["ArialUnicode_" + _language];

                        trace("FONTS: " + Font.enumerateFonts());
                }


...And here's the document class of the font SWF I'm loading in:

        package
        {
        import flash.display.Sprite;
        import flash.system.Security;
        import flash.text.Font;


        public class ArialUnicode_ENG extends Sprite
        {
                
[Embed(source='/Users/mike/MCDILL FONTS/A/Arial Unicode/Arial Unicode.ttf', fontName='ArialUnicode_ENG', unicodeRange='U+0041-U +0041,U+0042-U+0042,...')]


                public static var ArialUnicode_ENG:Class;
                
                
                public function ArialUnicode_ENG()
                {
                        Security.allowDomain("*");
                }       
        }
}


Anybody know what the problem might be?

Thanks for any help in advance,
_mike


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to