title: Embedding fonts: "Font with plain weight and style was not found at..."
body: <p>I am trying to embed a font in my Flash Builder 4.6 project, so far unsuccessful.
  I searched around and found this fix, adding "-managers flash.fonts.AFEFontManager" to the Compiler, doesn't work. I've embedded tons of images to the same project, but I'm not sure what's going on with the embedding of fonts.</p>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>Multiple markers at this line:</p>
    
    <p>-unable to build font 'Chinese Rocks Rg'</p>
    
    <p>-exception during transcoding: Font for alias 'Chinese Rocks Rg' with plain weight and style was not found at: file:/E:/StarlingIntro - >Finished/src/../assets/textures/chinese_rocks_rg.otf</p>
    
    <p>-Unable to transcode ../assets/textures/chinese_rocks_rg.otf.</p>
  </blockquote>
  
  <p>For the following code:</p>
  
  <pre><code>    [Embed(source="../assets/textures/chinese_rocks_rg.otf", fontName="Chinese Rocks Rg", fontWeight="normal", advancedAntiAliasing="true", embedAsCFF=false, mimeType = "application/x-font")] 
      public var ChineseRocks_FontClass:Class;
      public var chineseRocks_textFromat:TextFormat = new TextFormat("Chinese Rocks Rg");
  </code></pre>
  
  <p>What do they mean <code>was not found</code>? It's the same path as everything else I've embedded. Does it mean that it's expecting a certain "style" from the .otf file? Wut?</p>
  
  <p>Thanks for any info on this! </p>
  
  <p>PS: it gives the same error for other fonts as well, for example MyriadWebPro.ttf.</p>
  
  <h2>[EDIT]</h2>
  
  <p>Okay, here's what's going on. I am using this embed code right now:</p>
  
  <pre><code>[Embed(source="chinese_rocks_rg.otf", //yes, it's in my src folder because I'm paranoid 
              fontName = "myChineseRocks", 
              mimeType = "application/x-font", 
              fontWeight="normal", 
              fontStyle="normal", 
              unicodeRange="englishRange", 
              advancedAntiAliasing="true" 
  
      )]//embedAsCFF="false"
  </code></pre>
  
  <p>I have commented out the <code>embedAsCFF</code>, because I tried it with the <code>-managers=flash.fonts.AFEFontManager</code> compiler parameter. None of the two work.</p>
  
  <p>This is in Flash Builder 4.6, using Flex SDK 4.6.0. Now, if I switch to Flex SDK 3.6.0, the error seems to go away, but I can't use 3.6.0 since I'm using the Starling Stage3D framework.</p>
  
  <p>Is it possible that stuff changed from 4.0 to 4.6, and now your article, Divillysausages, (which really illuminated me btw) doesn't apply to it?</p>
  
  <h2>[EDIT2]</h2>
  
  <p>I solved it! With the help of Divillysausages and his patience :).</p>
  
  <p>Basically, I was completely stupid. I had a "#" and 2x" ` "s in the actual path to my project. I KNEW having those dumb folder names would screw my stuff up some day! And sure enough it did -with Java, but I moved Eclipse out of there a long time ago and forgot about it. </p>
  
  <p>Anyway, I moved the flash project to a more friendly directory and included the <code>embedAsCFF="false"</code> and it worked.
  Also, having <code>-managers=flash.fonts.AFEFontManager</code> in your compiler arguments or not, seems to not matter.</p>