var myFont:Font = new Font1();
var myFormat:TextFormat = new TextFormat();
myFormat.font = myFont.fontName;
myFormat.size = 2;
testfont.defaultTextFormat = myFormat;
if you want to add some more parameters to code
(just for reference)
/*var myTextField:TextField = new TextField();
myTextField.autoSize = TextFieldAutoSize.LEFT;
myTextField.defaultTextFormat = myFormat;
myTextField.embedFonts = true;
myTextField.text = "The quick brown fox jumped over the lazy dog.";
addChild(myTextField);*/
//testfont.autoSize = TextFieldAutoSize.LEFT;
Output :-
No comments:
Post a Comment