-
Notifications
You must be signed in to change notification settings - Fork 10
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 = 0x000000;
format.size = 28;
format.font = chars.fontName;
format.align = 'left';
format.bold = false;
this.setStyle('embedFonts', true);
this.setStyle('textFormat', format); // Apply style changes.