Posted By

pfeisinger on 05/18/09


Tagged

actionscript embed text font


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Demian
adrianparr


Embed Font From Library


 / Published in: ActionScript 3
 

  1. var embeddedFontsArray: Array = Font.enumerateFonts(false);
  2. for (var i:uint = 0; i < embeddedFontsArray.length; i++)
  3. {
  4. trace("fontName: " + embeddedFontsArray[i].fontName);
  5. }
  6.  
  7. var t:TextField = new TextField();
  8. addChild(t);
  9.  
  10. var tf:TextFormat = new TextFormat();
  11. tf.font = "Verdana";
  12. tf.size = 14;
  13.  
  14. t.embedFonts = true;
  15. t.defaultTextFormat = tf;
  16. t.antiAliasType = AntiAliasType.ADVANCED;
  17. t.text = "Verdana";
  18. t.autoSize = TextFieldAutoSize.LEFT;
  19.  
  20. stop();

Report this snippet  

You need to login to post a comment.