Ha, well ok. The vomit is

paramter font cannot be null

for Font.registerFont. The FontHolder class looks like so:

package
{
        import flash.display.Sprite
        
        public class FontHolder extends Sprite
        {
                [Embed(fontFamily="ArialBlack",
source="C://WINDOWS//Fonts//ariblk.TTF")]
                public static var ArialBlack:Class;
        }
}

So I'm really not sure what it's all about because it works fine
loading accessing the font on a PC with the exact same code. This code
to be exact:

        public class FontLoadingTest extends Sprite
        {
                public function FontLoadingTest()
                {
                        var ld:Loader = new Loader();
                        ld.contentLoaderInfo.addEventListener(Event.INIT, 
inited);
                        ld.load(new URLRequest("FontHolder.swf"));
                }
                
                private function inited(event:Event):void
                {
                        var t:Class =
event.target.applicationDomain.getDefinition("FontHolder") as Class;
                        Font.registerFont(t.ArialBlack);
                        var tf:TextField = new TextField();
                tf.defaultTextFormat = new TextFormat("ArialBlack", 12, 0);
                tf.embedFonts = true;
                tf.rotation = 15; // to demonstrate the embed worked
                tf.text = "blah blah blahnblah blah blahnblah blah blah ";
                addChild(tf);
                }
        }

Any ideas, humorous or otherwise?

--- In flexcoders@yahoogroups.com, Bjorn Schultheiss
<[EMAIL PROTECTED]> wrote:
>
> Depends what you ate or drank the night before,
> I mean the smell is probably interesting than what it looks like.
> 
> What it tastes like is a whole other story ;)
> 
> Just kidding, Alex...
> 
> 
> On 01/05/2007, at 4:24 PM, Alex Harui wrote:
> 
> >
> > What does the vomit look like?  And what does the FontHolder class  
> > look like?
> >
> >
> >
> > From: flexcoders@yahoogroups.com  
> > [mailto:[EMAIL PROTECTED] On Behalf Of joshuajnoble
> > Sent: Monday, April 30, 2007 6:29 PM
> > To: flexcoders@yahoogroups.com
> > Subject: [flexcoders] Loading Fonts at runtime on OSX?
> >
> >
> >
> > Wondering if anyone else has run into this: I'm loading fonts at
> > runtime via a swf that has a font embedded in it. I can't get the font
> > embedded on my OSX machine, so I compile the font swf on my pc and
> > then bring it over to my OSX machine and try to load it into the
> > application swf like so:
> >
> > private function fontSWFLoaded(event:Event):void
> > {
> > var holder:Class =
> > event.target.applicationDomain.getDefinition("FontHolder") as Class;
> > Font.registerFont( holder.Kartika );
> > videoOverlay.overlay.fontLoaded();
> > }
> >
> > It vomits every time on Font.registerFont. This exact same code works
> > fine on my PC. Now, I don't have Kartika
> > installed on my mac, which could be part of the problem I suppose so
> > my next is going to be trying with Arial, but does anyone have any  
> > ideas?
> >
> >
> >
> >
>


Reply via email to