Embed Font From Library


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.