May 9, 2010

Building classes with MXMLC

Since the recent post of the UTFCompressor, you might wonder what the hell it´s good for or, just how this will speed up the workprocess when exporting optimized fonts.

Ideally I would write an app that exports a flash font based on a font file directly. Bam you're done.

But then you would have no control over which glyphs are included, some Unicode fonts are extremely large (> 10 MB). This would then wreak havoc online if say you're doing an Asian website in flash, going about it coding in AS3. Every visitor has to load > 10 MB just to see the site.

You could just make shapes of all the texts on the website, but hey. Where's the fun in that?

Right now the AIR platform doesn't support execution of native processes, but that will soon change. For now you will have to make do with this short second phase of font generation.

The Flex SDK uses a binary to compile Actionscript 3. Senocular has a great tutorial on using this to compile your own swf:s.

http://www.senocular.com/flash/tutorials/as3withmxmlc/

1. Add your flexSDK/bin folder in the system path variable.

2. Make a .bat-file with contents similar to:

mxmlc %1 -output %1.swf -as3


3. In UTF Compressor there is this option

Use that to save a class and drop it onto your .bat-file. Now you should have a Flash font lying around somewhere.


If you don't have the Flex SDK, go ahead and download it here.

Go ahead and grab the UTF Compressor while you're at it.

No comments: