Skip to main content
Known Participant
March 24, 2010
Answered

Fonts will not embed

  • March 24, 2010
  • 1 reply
  • 431 views

I am trying to embed a font in my actionsrcipt and the characters don't display at all when the embedFont = true. If it is set to false it displays the characters. I really need this to work because I want to maintain consistency with the font used through out the site. The problem is that its not a common device font. The TextField is set up in another class I created and the the text formating is applied when the for loop runs in the initialization of the class I'm working in. I've tried everything I can think of and it just will not embed the font and display it. I hope the following is enough code to diagnose. I thank you in advance for you help!

public function tabClass()

{

for (var i:int = 0; i < counter; i++) {

a = new navTabButton();

a.x=600;

a.y=nextY;

addChild(a);

nextY+=36;

a.outputText.text=String(i+1);

a.outputText.selectable=false;

myFormat.size = 25;

myFormat.font = "18 VAG Rounded Bold   07390";

a.outputText.embedFonts = true;

a.outputText.setTextFormat(myFormat);

a.alpha=.5;

movies.push(a);

a.addEventListener(MouseEvent.MOUSE_OVER, cont1);

}

}

This topic has been closed for replies.
Correct answer kglad

you're not embedding the font correctly.

first, you need a font in your library that's being exported for use by actionscript and it needs a class.  have you done that?

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
March 24, 2010

you're not embedding the font correctly.

first, you need a font in your library that's being exported for use by actionscript and it needs a class.  have you done that?

Known Participant
March 24, 2010

No, I did not know I needed to do that. I just did it and it works just fine! I should have come here first, I just wasted an hour trying to figure it out. The fact that the font needs to be in the library isn't clearly stated in the documentation. I was thinking that it would just copy it from the system or something. That's what I get for thinking! Thanks so much Kglad, your a huge help!

kglad
Community Expert
Community Expert
March 24, 2010

you're welcome.