0 Replies Latest reply on May 25, 2011 12:58 PM by TWV321

    Embed via systemFont looks different than via source

    TWV321

      Hello all!

       

      I'm trying to deal with an odd issue related to embeding fonts... here it is...

       

      I am embeding some fonts into an swf that is loaded by my main swf.

       

      I am embeding them like so:

       

      [Embed(systemFont="Calibri", fontName = "CalibriEmbed", mimeType = "application/x-font", fontWeight = "normal", fontStyle = "normal",
          unicodeRange = "<UNICODE RANGES HERE>",
          advancedAntiAliasing = "true")]
      var Calibri:Class;

       

      Now when I assign the embeded font to a textfield (via actionscript) like:

       

      var modifiedFormat:TextFormat;

      ...

      modifiedFormat.font = "CalibriEmbed";

      txtField.setTextFormat(modifiedFormat, 0, txtField.text.length);

       

      The text that is displayed seems to have a different line height than the same text field which has Calibri assigned to it via the properties panel in Flash.  I can somewhat compensate for this by adding some leading to the TextFormat, but that isn't ideal.

       

      The odd thing is if I embed the font by using source instead of systemFont it works just fine... ie:

       

      [Embed(source="<PATH>\CALIBRI.TTF", fontName = "CalibriEmbed", mimeType =  "application/x-font", fontWeight = "normal", fontStyle = "normal",
           unicodeRange = "<UNICODE RANGES HERE>",
           advancedAntiAliasing = "true")]
      var Calibri:Class;

       

      Any ideas why it is doing this?

       

      Thanks!