3 Replies Latest reply on May 10, 2011 2:37 PM by aspjut

    Ant, mxmlc and font managers

    rockstarmode

      My team is building an AIR application and we are using SVN and a Flex Ant task to compile it on a staging server.  I have a decent understanding of what each piece of the compilation process needs to run and got the AIR application compiled and packaged without too much hassle.

       

      We recently switched fonts and require the command line switch '-managers=flash.fonts.AFEFontManager' in Flex Builder.  I've been reading about how to get this done and have found two solutions:

       

      1) Edit the file frameworks/flex-config.xml and change the order of the font managers.  This isn't a great solution because every time we upgrade the SDK on the server we'll have to go through and make this change again.  This process is described in the adobe livedocs http://livedocs.adobe.com/flex/3/html/help.html?content=fonts_06.html

       

      2) Set it as a managers attribute in the ant build file as described here http://stackoverflow.com/questions/610386/how-to-include-additional-compiler-arguments-whe n-using-mxmlc-ant-task I can't seem to get this to work, I end up with an error like this:

       

      src/build.xml:75: The <mxmlc> type doesn't support the "compiler.fonts.managers" attribute.

       

      I get the same error when I use the "managers" alias.

       

      My question is what is the preferred method of reordering the font managers?  Thanks in advance!

        • 1. Re: Ant, mxmlc and font managers
          rockstarmode Level 1

          I forgot to attach the relevant section of my build.xml, here it is:

           

              <target name="compile.release"

                  description="Compile swf modules and main swf" depends="clean">

                  <!-- compile main SWF -->

                  <mxmlc file="${src.dir}/application.mxml"

                      output="${out.dir}/application.swf"

                      debug="${DEBUG}"

                      optimize="${OPTIMIZE}"

                      link-report="${out.dir}/swf-report.xml"

                      locale="en_US"

                      configname="air"

                      compiler.fonts.managers="flash.fonts.AFEFontManager">

           

                      <source-path path-element="${src.dir}" />

                      <library-path dir="${FLEX_HOME}/frameworks/libs" append="true">

                          <include name="*.swc" />

                      </library-path>

                      <library-path dir="${FLEX_HOME}/frameworks/libs/air"

                          append="true">

                          <include name="*.swc" />

                      </library-path>

                      <library-path dir="${FLEX_HOME}/frameworks/locale" append="true">

                          <include name="{locale}" />

                      </library-path>

                      <library-path dir="${lib.dir}" append="true">

                          <include name="*.swc" />

                      </library-path>

                  </mxmlc>

          • 2. Re: Ant, mxmlc and font managers
            rockstarmode Level 1

            I forgot to mention that editing flex-config.xml doesn't work as I'm building an AIR file, instead editing air-config.xml does the trick.  This is still not a great solution, I'm hoping someone can help me solve this via the Ant task

            • 3. Re: Ant, mxmlc and font managers
              aspjut

              This is an old post but I ran into this and fond this as a solution.

               

              <mxmlc ...> 

                   <fonts>

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

                   </fonts>

                   ...

              </mxmlc>

               

               

              If your not using the ant task you can do this:

               

              <java jar="${MXMLC.JAR}" fork="true" failonerror="true" maxmemory="256m">

                  <arg value="-compiler.fonts.managers=flash.fonts.AFEFontManager"/>

                   ...

              </java>