title: AS3 Font Embedding with htmlText
body: <p>I have a dynamic textfield which uses html text loaded form an XML file:</p>
  
  <p>XML:</p>
  
  <pre><code>&lt;someText&gt;&lt;![CDATA[I am &lt;i&gt;some&lt;/i&gt; text.]]&gt;&lt;/someText&gt;
  </code></pre>
  
  <p>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:</p>
  
  <p>Font var: <code>private var regularFont:Font = new myFontRegular();</code></p>
  
  <p>myFontRegular is embedded using the embedding dialogue, but is set to regular, not italic.</p>
  
  <p>Textfield formatting: <code>bodyFormat.font = regularFont.fontName;</code></p>
  
  <p>To set up the textfield:</p>
  
  <pre><code>bodyField.embedFonts = true;
  bodyField.defaultTextFormat = bodyFormat;
  bodyField.multiline = true;
  bodyField.wordWrap = true;
  bodyField.antiAliasType = "advanced";
  bodyField.selectable = false;
  </code></pre>
  
  <p>I then set the textfield to htmlText and give it content:</p>
  
  <pre><code>bodyField.htmlText = pageBody;
  </code></pre>
  
  <p>pageBody is a var that is fed from the XML.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>Thanks.</p>