title: Embed fonts in Actionscript 3 project
body: <p>I'm trying to embed a font to my Actionscript 3 project in Flash Builder 4.5. I've found several examples and fixes, but none of them has my problem. My embedded font shows up in the enumeratedFonts list and I get no errors, but it just falls back to the system default font when I use it in my TextFormat. I've tried using several Embed()-attributes and compiler-arguments from this post: <a href="http://divillysausages.com/blog/as3_font_embedding_masterclass" rel="nofollow">http://divillysausages.com/blog/as3_font_embedding_masterclass</a></p>
  
  <pre><code>package {
  import flash.display.Sprite;
  import fl.text.TLFTextField;
  import flash.text.TextFieldAutoSize;
  import flash.text.Font;
  import flash.text.TextFormat;
  import flashx.textLayout.elements.*;
  import flashx.textLayout.formats.*;
  
  public class FontTest extends Sprite {
      [Embed(source="assets/Nanami.otf", fontName="NanamiRegular", embedAsCFF= "false")]
      private var myEmbeddedFont:Class;
  
      public function FontTest() {
          var fonts:Array = Font.enumerateFonts(false);
  
          for(var i:int = 0; i &lt; fonts.length; i++) {
              trace(fonts[i].fontName);
          }
  
          var fmt:TextFormat = new TextFormat();
          fmt.color = 0xFF0000;
          fmt.font = "NanamiRegular";
          fmt.size = 32;
  
          var tlfTxt:TLFTextField = new TLFTextField();
          tlfTxt.defaultTextFormat = fmt;
          tlfTxt.embedFonts = true;
          tlfTxt.border = true;
          tlfTxt.text = "Lorem ipsum dolor sit amet.";
          tlfTxt.wordWrap = true;
          tlfTxt.width = 300;
          tlfTxt.autoSize = TextFieldAutoSize.LEFT;
          tlfTxt.x = tlfTxt.y = 40;
          tlfTxt.rotation = 20;
          addChild(tlfTxt);
      }
  }
  </code></pre>
  
  <p>}</p>