0
votes

Is there a way to create embedded "pure as3" swf fonts using compc (without the flex framework integration)? If I embed a font like this in my as3:

package fonts
{

import flash.display.Sprite;
import flash.text.Font;

public class Helvetica extends Sprite
{

    [Embed(source='Helvetica.otf', fontName='Helvetica')]

    public static var Helvetica :Class;

    Font.registerFont( Helvetica  );

}
}

using compc.exe -compiler.keep-generated-actionscript=true

I see flex makes some boilerplate as3 code including things like this:

import mx.core.IFlexModule;
import mx.core.IFlexModuleFactory;
import mx.core.EmbeddedFontRegistry;

which prevents me from using the embedded font in "pure as3" projects. Is there a way to get flex-free fonts using compc?

I am hoping there is an easy solution like this one for Bitmap Assets.

1
Did you apply the method described in the article following your link? It might work for you too. I'm just sayin'...bug-a-lot
The fonts are a bit more complicated. Their boilerplate attempts to register with the 'mx.core::IEmbeddedFontRegistry' forums.adobe.com/message/1885964jedierikb

1 Answers

2
votes

well, i think the method disrribed should work anyhow ... you just got to replace few more classes ... probably EmbeddedFontRegistry, so it won't have any dependancies ... just stuff in an empty method ...

greetz

back2dos