just for my sanity

embedding fonts in AS3 is just slightly more complicated than it appears to be.

[Embed(source='../asset/fonts/CENTURY.TTF', fontName="embed_CENTURY", mimeType="application/x-font-truetype")]
public static const FONT_CENTURY:String;
var EffectTxt:TextField = new TextField;
var format:TextFormat = new TextFormat("embed_CENTURY");
EffectTxt.embedFonts = true;

I always forget that last line, because if you have the font installed on your system, and if the font name you use for the embed is the same as the font's system name, it will use the device font and it will look fine.  Cost me about 2.5 hours today.

grumpy face.

No comments:

Post a Comment