Problem Embedding Fonts using AS3

  • FIRESCAPE_
  • Born
  • Born
  • User avatar
  • Posts: 2
  • Loc: My House!

Post 3+ Months Ago

So am trying to embed some fonts so that text from an xml display in the cute pixel font, FFF Urban. In my library I have embedded and exported the font for actionscript and given it the class name of FFF_Urban. My problem is that it doen't display the text once I test out the published files. I remove the footerText.embedFonts = true; line and the font displays, just not in my pixel font. Anyone know what the problem may be???

Code: [ Select ]
function createFooterText():void{
    // Create the text format
    var myFont = new FFF_Urban();
    var tsFont = new TextFormat();
            
    // Set the attributes
    tsFont.font = myFont.fontName;
    tsFont.size = 8;
    tsFont.color = 0x000000;
    
    var footerText:TextField = new TextField();
    footerText.alpha = 0;
    footerText.htmlText = xml.copyrightText.articleText;
    footerText.selectable = false;
    footerText.defaultTextFormat = tsFont;
    footerText.antiAliasType = AntiAliasType.ADVANCED;
    footerText.gridFitType = GridFitType.PIXEL;
    footerText.autoSize = TextFieldAutoSize.LEFT;
    footerText.embedFonts = true;
    footerText.wordWrap = false;
    
}
  1. function createFooterText():void{
  2.     // Create the text format
  3.     var myFont = new FFF_Urban();
  4.     var tsFont = new TextFormat();
  5.             
  6.     // Set the attributes
  7.     tsFont.font = myFont.fontName;
  8.     tsFont.size = 8;
  9.     tsFont.color = 0x000000;
  10.     
  11.     var footerText:TextField = new TextField();
  12.     footerText.alpha = 0;
  13.     footerText.htmlText = xml.copyrightText.articleText;
  14.     footerText.selectable = false;
  15.     footerText.defaultTextFormat = tsFont;
  16.     footerText.antiAliasType = AntiAliasType.ADVANCED;
  17.     footerText.gridFitType = GridFitType.PIXEL;
  18.     footerText.autoSize = TextFieldAutoSize.LEFT;
  19.     footerText.embedFonts = true;
  20.     footerText.wordWrap = false;
  21.     
  22. }
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

move the line footerText.defaultTextFormat = tsFont;
above the line footerText.htmlText = xml.copyrightText.articleText;
Just a matter of priorities.
I know, i know, no need to thank me :)

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 14 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.