I have a dynamic textfield which uses html text loaded form an XML file:
XML:
<someText><![CDATA[I am <i>some</i> text.]]></someText>
As you can see, this uses regular and italic. I have embedded my font in all it's varieties, every single glyph, but the italic text isn't showing. My AS3:
Font var: private var regularFont:Font = new myFontRegular();
myFontRegular is embedded using the embedding dialogue, but is set to regular, not italic.
Textfield formatting: bodyFormat.font = regularFont.fontName;
To set up the textfield:
bodyField.embedFonts = true;
bodyField.defaultTextFormat = bodyFormat;
bodyField.multiline = true;
bodyField.wordWrap = true;
bodyField.antiAliasType = "advanced";
bodyField.selectable = false;
I then set the textfield to htmlText and give it content:
bodyField.htmlText = pageBody;
pageBody is a var that is fed from the XML.
OK, so that's set up but italic text doesn't show, which I guess is because the embedded font is set to regular, not italic. So how can I use italic half way through a sentence for example? I've Googled and tried various methods to embed the font directly in code, same problem.
This has worked fine for me before, I don't understand what is wrong with this. If I need to post more, please let me know.
Thanks.