View Full Version : Embedded Fonts Mystery!!

11-13-2009, 06:43 PM
Hey there, I have a mega mystery that needs solving in regards to embedded fonts.

I have generated an swf file that contains my embedded font of specified Unicode range, then I am loading this swf into my application. The code in the generated file for the font, automatically registers the font using the Font.registerFont method.

I then load this swf file into my application, I never add it to the display list, I just created an instance of the file so that the code is executed to register the font.

Then I use the font name when I create embedded text fields and there you go it works... well it used to, I am not having any luck at the moment though. Sometimes it displays fine, other times it all appears cut off and I see a few pixels of the text I am trying to display.... Anyone else had a similar issue? Know what it might be?

I have created a class below that I am using for the embedded font text, any issues people see with this? Thanks for your help.

public class EmbededTextField extends TextField
public function EmbededTextField(fontName:String, size:int, color:uint, passedX:int, passedY:int, align:String, passedSelectable:Boolean = false)

selectable = passedSelectable;
x = passedX;
y = passedY;
embedFonts = true;
antiAliasType = AntiAliasType.ADVANCED;
autoSize = TextFieldAutoSize.LEFT;
defaultTextFormat = new TextFormat(fontName, size, color,null,null,null,null,null,align);


11-13-2009, 06:56 PM
Well, possibly I found the answer, might just be a coincidence though. I removed the line antiAliasType and it hasn't played up since.. not sure if its related, or how it could effect it intermittently... we will see..