Modern addiction: ActionScript 3.0 Chit chat about AS 3.0, OO concepts, and Flash in general…

26Aug/090

AntiAliasing dynamic TextField

Problem

Problem comes up when you dynamically add TextField with special font to your movie. You can create empty dynamic TextField on stage and embed fonts in it. Then you have global access to that font from TextFields through your classes. But by default you have No Bitmap antialiasing turned on. So your font looks distorted.

Solution

Assuming you embedded fonts which you will use, to fix this problem there is class AntiAliasType. TextField contains property antiAliasType which you will need to set.

var format:TextFormat = new TextFormat( "Calibri" );

textField.text = "Some text.";
textField.embedFonts = true;
textField.antiAliasType = AntiAliasType.ADVANCED;
textField.setTextFormat( format );

Don't forget importing:

import flash.text.AntiAliasType;
Filed under: Tutorials Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.