Embed fonts in AS3 with TextInput component - mhulse/mhulse.github.io GitHub Wiki
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.