1 Reply Latest reply on Dec 18, 2009 12:46 PM by Flex harUI

    how to embed an OpenType font in Beta 2?

    kearn7777

      Hi Folks

       

      I'm trying to embed an OpenType font into a Flash Builder Beta 2 project and haven't been successful yet.

       

      What I've tried so far:

       

      1. changing the order of the font managers in the flex-config.xml file, to put the one that handles OpenType first:

       

      <manager-class>flash.fonts.AFEFontManager</manager-class>

       

      2. in the .css file for the main mxml file, changing   embedAsCFF: true;  to embedAsCFF: false;

       

      3. embedding the font using a .swf file containing the font made in Flash CS3, and referencing that in the .css file

       

      4. embedding the font in <fx:Script/> using [embed]. Got an error message on the src line (Embed is only supported on classes and member variables.)
      .

      [Embed(source="/Library/Fonts/CalliopeMVBStdRg.otf",

               fontStyle = 'normal',

               fontName='Calliope MVB Std Regular',

               mimeType='application/x-font',

               embedAsCFF="true")]

       

      Any ideas on what my mistake is?

       

      Thanks for your attention

       

      Kearney Buskirk

        • 1. Re: how to embed an OpenType font in Beta 2?
          Flex harUI Adobe Employee

          It should just work in CSS with @font-face.  What error did you get?

                  @font-face

           

          When you tried #4 did you add the in front of a member variable?

           

          [Embed(source="/Library/Fonts/CalliopeMVBStdRg.otf",

                   fontStyle = 'normal',

                   fontName='Calliope MVB Std Regular',

                   mimeType='application/x-font',

                   embedAsCFF="true")]

          public static var CalliopeRegular:Class;

           

          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

          Blog: http://blogs.adobe.com/aharui