0

Let's start from the beginning of this magical research encounter that's making me want to strangle someone.

I'm trying to get an Embedded font to display in flash. What's started off as a simple, I can do this is now irritating.

Here's how I've embedded the font in my assets folder.

[Embed(source = '../lib/font/VT323-Regular.ttf', fontName = 'pixelText', embedAsCFF = 'false')]
    internal static var pixelText:Class;
    Font.registerFont(pixelText);

I've used all of the tags, mimeType ect. with no avail so I've simplified it for now.

Here's how I'm setting the format I'm using

internal static var $TitleText:TextFormat;
private function textSetup():void {
        GV.$TitleText = new TextFormat();
        GV.$TitleText.bold = true;
        GV.$TitleText.size = 50;
        GV.$TitleText.color = 0xFFFFFF;
        GV.$TitleText.font = 'pixelText';
        trace(GV.$TitleText);
    }

I then summon the format to the textfield as so...

var titleText:TextField = new TextField();
        titleText.embedFonts = true;
        titleText.defaultTextFormat = GV.$TitleText;
        titleText.text = itemName;
        titleText.selectable = false;
        titleText.setTextFormat(GV.$TitleText);
        titleText.x = 0;
        titleText.y = 0;

The text formatting works perfectly until I set .embedFonts to true. After that the text just disappears from screen. I've tried this with antiAliasType set to Advanced. It just doesn't like the .embedFonts option for some odd reason.

If anyone has any suggestion it would be greatly appreciated, I've noticed this is a common question and I haven't been able to remedy it after searching for three hours.

I just want my font to show up.

1 Answers1

0

It's probably the order in which you are doing things. Defining the text before setting your format options is probably the problem. Here is another answer:

Link: You should apply defaultTextFormat before the setting of the text or use TextField.setTextFormat for the existed text

Community
  • 1
  • 1
ozmachine
  • 201
  • 1
  • 3