Hey list,

i have been having a shit storm of a time with Fonts. I am not sure how to
move forward.

*Setup:*

For close to a year, i have been embedding fonts into swc files. Simple,
use embed syntax, give it a class to be, then Font.registerFont() that
class. (The static of it is the brilliance of never having to instantiate
an object or call a function. As soon as the class is referenced at
runtime, all the fonts get registered)

Their setup is like this:

class FontManifest {

    [Embed(source='helvetica.otf', fontName='helvetica', embedAsCFF='false'
)]
    static private var HELVETICA_FONT:Class;



    static public var HELVETICA:String = "Helvetica";

    Font.registerFont(HELVETICA_FONT);

}



This works fantastic. Then, my application references the swc, and can use
the fonts!



Then next crucial aspect of my problem, is that this compiled swf that uses
the font swc, is embedded into another swf. We use again [Embed] syntax to
embed this 'module' into our parent application.
We then use loader.loadBytes() to create the swf and use it in the main
application.

The setup is like this:

[Embed(source='module.swf', mimeType='application/octet-stream')]
public class EmbeddedModule extends ByteArray { }

// separate class
var context:LoaderContext = new LoaderContext(false, new ApplicationDomain()
);
var _loader:Loader = new Loader();
_loader.loadBytes(new EmbeddedModule(), context);

This is not exact code (we have a fairly large async framework we use, but
these are the important parts). This works!
Everything loads fine and works fine.



*The Problem:*

recently, i have needed to run my applications in FP9 (whereas before i was
in FP10).

Since i have started running in FP9 i get this error:
[Fault] exception, information=ArgumentError: Error #1508: The value
specified for argument font is invalid.

I have read many things on the internet about it being localhost related,
and applicationDomain problems. These have offered very little insight for
me.

The swf that is attempting to embed fonts lives in a sibling app domain.
(by virtue of specifying a new ApplicationDomain in the loader context);
That swf is embedded into the main swf at compile time.
i am not loading it twice (which i hear registering the same font twice can
cause this problem)

The only thing that has changed is I am now running it in FP9.0.280.

I tried putting my compiled swf on a server, and running it in the browser.
(it did not work using 9.0.280, but works using 10.2)
no matter what i try to do differently, it never works in 9.0.280, but
works in 10.0 or higher.

*Any Ideas?*


-- 
Ktu;

The information contained in this message may or may not be privileged
and/or confidential. If you are NOT the intended recipient,
congratulations, you got mail!
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to