Posted By

adamcoulombe on 12/22/09


Tagged

actionscript flash embed alias font anti as3


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

babyC
abbey
tspitzr


Embedding Fonts for Anti Aliasing in Flash AS3


 / Published in: ActionScript 3
 

URL: http://www.republicofcode.com/tutorials/flash/as3text/

  1. // To use this method you must embed and "Export for AS" the font in the Flash IDE (eg. Flash CS3, Flash CS4).
  2. // You Can do this by clicking the menu on the library panel, then go "New Font"
  3. // Then select "Export for Actionscript, and give your font class name.
  4. // The class name is the name that you will reference on the line directly below this.
  5.  
  6. var myFont = new MyFontClassName();
  7.  
  8. var myFormat:TextFormat = new TextFormat();
  9. myFormat.size = 40;
  10. myFormat.font = myFont.fontName;
  11.  
  12. var myText:TextField = new TextField();
  13. myText.defaultTextFormat = myFormat;
  14. myText.embedFonts = true;
  15. myText.antiAliasType = AntiAliasType.ADVANCED;
  16. myText.autoSize = "left";
  17. myText.text = "Here is some pretty that is anti-aliased!";
  18. addChild(myText);

Report this snippet  

You need to login to post a comment.