1 Reply Latest reply on May 1, 2012 11:33 AM by Flex harUI

    Embedded fonts not displaying when building project via mxmlc


      I have a flex 3 project and I'm trying to upgrade it to flex 4.6 sdk. I have a number of embedded fonts in my application. These display fine when I build via Eclipse/Flash builder. When I build using mxmlc the embedded fonts are not being used. I build the fonts in the same way for both so I am assuming there is some compiler option which I am missing, or which I have that is causing the problem. I've tried every compiler option I can think of and now I'm at a dead end...

      <target name="compile" depends="getswcs, compilemodules">  
           <echo message="mxmlc=${mxmlc}"/>
           <echo message="flex.lib.dir=${flex.lib.dir}"/>
           <echo message="flex.extlib.dir=${flex.extlib.dir}"/>
           <echo message="flex.locale=${flex.locale}"/>
           <echo message="flex.locale.dir=${flex.locale.dir}"/> 

           <exec executable="${mxmlc}" dir="${basedir}" failonerror="true">
                <arg line="'src/${main}'" />
                <arg line="-o 'bin/${component.lowercase.name}.swf'" />
                <arg line="-l+='${flex.lib.dir}'" />
                <arg line="-sp src" /> <arg line="-accessible" />
                <arg line="-strict" />
                <arg line="-el '${flex.extlib.dir}'" />
                <arg line="-compatibility-version=3.0.0" />
                <arg line="-target-player '11.1'" />
                <arg line="-include-libraries+=lib" />
                <arg line="-locale ${flex.locale}" />
                <arg line="-l+='${flex.locale.dir}'" />

      The compileModules builds my fonts, for example:

      <exec executable="${mxmlc}" dir="${basedir}" failonerror="true"> 
           <arg line="fonts/OCRAEXT.as" />
           <arg line="-static-link-runtime-shared-libraries" />
           <arg line="-o bin/lib/OCRAEXT.swf" />

      as file:

      public class OCRAEXT extends Sprite { 
           [Embed(source='OCRAEXT.TTF', fontName='_OCRAEXT', embedAsCFF='false', unicodeRange='U+0030-U+0039,U+002E,U+002F,U+20AC')]
      public static var font:Class; }

      I don't think there's an issue here, since the fonts are already built via my compileModules before building the application in Eclipse, where the fonts display correctly.