hi folks,
this week i had to externalize fonts in an AS3 project. so i looked into my delicious links and found two very good tutorials, one by Troy Gardner on the TroyWorks blog and another one by Deden Ramadhan on the ini na!! blog.
in the first moment everything worked fine and i had no problems embedding the fonts, loading them and finally using them at runtime. i like how it works!
some days later i had to embed cyrillic, chinese and japanese characters from an ArialUnicodeMS.ttf font. then i always got the error message: “Error: Unable to transcode ArialUnicodeMS.ttf.”, at compile time. the first idea was that there’s something wrong with the ArialUnicodeMS.ttf file, because it works fine with other font files. so i tried another ArialUnicodeMS.ttf file from a colleague, but the result was the same error message. using google wasn’t that much successful, but i got a hint from a colleague that
flex includes several font managers to handle embedded fonts, exactly three. here you can find some informations about the three managers in the livedocs.
so the solution for my problem was to use the flash.fonts.AFEFontManager and everything works fine. to change the font manager you can simply use the compiler argument:
-managers flash.fonts.AFEFontManager
for your mxmlc compiler.
if you work in a team and use FDT 3.0. one of the most important things is, that you and your colleagues have the same core library settings.
you can find these preferences in
~workspace~/.metadata/.plugins/org.eclipse.core.runtime/.settings.
there you will find several files for eclipse preferences.
the important ones for FDT 3.0 are
com.powerflasher.fdt.core.formatter.prefs, com.powerflasher.fdt.core.prefs, com.powerflasher.fdt.core.problems.prefs, com.powerflasher.fdt.ui.prefs and org.eclipse.core.resources.prefs.
to save or share your core library settings just copy these two files com.powerflasher.fdt.core.prefs and org.eclipse.core.resources.prefs into the folder
~workspace~/.metadata/.plugins/org.eclipse.core.runtime/.settings
in the workspace of your co-worker. maybe you have to adjust the pathes for the pathvariables in the org.eclipse.core.resources.prefs -file.
today i started to migrate an old FDT 1.5 project to FDT 3.0 and
i like to share my experience with you. the only things you have to do are:
1.) add the ~com.powerflasher.fdt.core.prefs~ -file to your .settings folder (copy it from an other project)
2.) open the ~.as2_classpath~ -file, rename ~AS2Classpathes~ to ~AS2Classpath~ and add the attributes ~generateProblems=”true”~ and ~useAsSharedCode=”false”~ to the <AS2Classpath> -tags
3.) open the ~.project~ -file,
reneame ~com.pf.fdt.IncrementalProjectBuilder1~ to ~com.powerflasher.fdt.core.FlashBuilder~,
rename ~com.pf.fdt.FlashNature~ to ~com.powerflasher.fdt.core.FlashNature~,
rename ~location~ to ~locationURI~ and replace ~whatever~ with ~AS2_CORE_DEFAULT~ between the <locationURI> -tags
that’s it. i’ve created a small cheat-sheet for the migration.
