Return to Snippet

Revision: 21828
at December 22, 2009 11:27 by adamcoulombe


Initial Code
// To use this method you must embed and "Export for AS" the font in the Flash IDE (eg. Flash CS3, Flash CS4).
// You Can do this by clicking the menu on the library panel, then go "New Font"
// Then select "Export for Actionscript, and give your font class name.
// The class name is the name that you will reference on the line directly below this.

var myFont = new MyFontClassName();

var myFormat:TextFormat = new TextFormat();
myFormat.size = 40;
myFormat.font = myFont.fontName;

var myText:TextField = new TextField();
myText.defaultTextFormat = myFormat;
myText.embedFonts = true;
myText.antiAliasType = AntiAliasType.ADVANCED;
myText.autoSize = "left";
myText.text = "Here is some pretty that is anti-aliased!";
addChild(myText);

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

Initial Description


Initial Title
Embedding Fonts for Anti Aliasing in Flash AS3

Initial Tags
actionscript, flash

Initial Language
ActionScript 3