Wednesday 15 April 2015

actionscript 3 - Adobe CC Flash Pro: Proper way to embed and use fonts? -



actionscript 3 - Adobe CC Flash Pro: Proper way to embed and use fonts? -

i upgraded adobe cc adobe cs6, , none of text showing in flash professional project anymore. contains lot of dynamic text , htmltext. i'm not quite sure if doing before, read several guides explained different methods, @ to the lowest degree working.

i've had success in trying prepare everything, appreciate if tell me proper way adobe cc. here's how i'm trying now.

add font library, check "export actionscript" box, , assign class name.

create instance of font , bold , italic versions:

var myfont:font = new myfont(); var myfontbold:font = new myfontbold(); var myfontitalic:font = new myfontitalic();

set textformat:

var mytextformat:textformat = new textformat(); mytextformat.font = myfont.fontname;

set textfield , apply textformat:

var mytextfield:textfield = new textfield(); mytextfield.defaulttextformat = mytextformat;

this text display, if seek putting bold or italic tags in htmltext, neither of them work.

mytextfield.htmltext = "this <b>bold</b>. <i>italic</i>.";

also, need font.registerfont anymore? had in previous code, never sure why needed it.

try creating , setting style sheet assigns bold , italic versions of font appropriate tags:

var style:stylesheet = new stylesheet(); style.setstyle("i", {fontfamily: myfontitalic.fontname}); style.setstyle("b", {fontfamily: myfontbold.fontname}); mytextfield.stylesheet = style; mytextfield.htmltext = "this <b>bold</b>. <i>italic</i>.";

actionscript-3 flash embedded-fonts flash-cc

No comments:

Post a Comment