0 Replies Latest reply on Mar 22, 2010 1:29 PM by arithma

    Embed OTF Font as CFF in Pure Actionscript Project using Flex SDK 4.0


      I want to apply the method explained here: http://www.insideria.com/2009/03/flash-text-engine.html using only the Flex SDK 4 (not using FlashBuilder)


      Embedding fonts can be tricky. In Flex, embed the font and store it using DefineFont4 and font subsetting currently only supported by Gumbo. A future version of Flash will support it but in the meantime, a Gumbo SWC with the embedded font must be created then adding to your Flash CS4 project.


      The following is the method I am using to embed the fonts.

      public class Main extends Sprite {
           [Embed(source="../assets/GE Thameen DemiBold.otf",
                                    fontFamily = "GE Thameen",
                                    fontWeight = "bold",
                                    mimeType = "application/x-font",
                                    embedAsCFF = "true"
           private const GEThameen:Class;


      The following command line was assimilated after solving the output error messages using google and a little looking into how FlashDevelop works..

      mxmlc Main.as -load-config config.xml -managers flash.fonts.AFEFontManager


      The output SWF is not working as supposed, and the file size (20KB) does not seem to account for the embedded font. PS: When the font embedding is bypassed, and a device font is used for the text engine classes, the file works perfectly.


      The contents of config.xml are as the following:

      <?xml version="1.0" encoding="utf-8"?>
      <!--This Adobe Flex compiler configuration file was generated by a tool.-->
      <!--Any modifications you make may be lost.-->
          <source-path append="true">