-
Notifications
You must be signed in to change notification settings - Fork 8
Embed fonts in AS3 with TextInput component
Michael Hulse edited this page Nov 9, 2015
·
3 revisions
Because this was such a headache, I’m documenting it here:
From the Libray panel flyout menu, choose “New Font...”:
Self-explanatory settings:
Here’s the code:
var format:TextFormat = new TextFormat();
var klass:Class = getDefinitionByName('DynaFont') as Class;
var chars:Font = new klass(); // Or, just `new DynaFont()`.
format.color = _color;
format.size = _size;
format.font = chars.fontName;
format.align = _align; // Default left alignment.
format.bold = _bold;
this.setStyle('embedFonts', true);
this.setStyle('textFormat', format); // Apply style changes.