FontSwffer
![]()
Creating font-asset SWFs for Flash used to be a bit of a pain. But now, there's FontSwffer.
FontSwffer is an Air 2 native application for Windows and OSX that lets you configure, build, and preview your font SWFs all in one place. All you need to do is set-up the fonts you want to embed and press a button, that's pretty much it. If you just want the font embed ActionScript to use in your own work-flow, FontSwffer can create that for you too.
FontSwffer uses the Flex 4 SDK to compile your SWFs, just point it to the location of the SDK on your hard-drive and you're good to go.
Adding and setting up fonts is a fairly straight forward affair; the title bar on each font you add gives feedback on any required information, and all the buttons or inputs have tool-tips to guide you if you're unsure of their function.
The first four items in the glyph ranges list selector, the ones with names starting with a '-', are custom ranges that we find useful and work with regularly here at MadeByPi. The custom ranges are defined in the customRanges.xml in the application directory. Feel free to modify the existing ranges and add your own as required, the process is simplified by allowing input of ranges as glyphs rather than Unicode U+Hex ranges.
The rest of the available ranges are parsed directly from the flash-unicode-table.xml, a part of the Flex SDK. You can add multiple ranges by holding Ctrl to add a single item, or Shift to select ranges.
Once you have one or more fonts configured it's just a case of clicking the Build SWF or build Class button. If you're build a font SWF, assuming the compiler completes successfully, the resulting SWF will be loaded and displayed in the Font Previewer. When created, your font SWFs and/or classes will be saved to your desktop, in directory called "/FontSwffer_output".
The Font Previewer tool takes a compiled SWF (generated by FontSwffer) and displays the font(s) contained within, alerting you to any glyphs that were missing from the fonts when the TTF / OTF files were transcoded and embedded into the SWF.
By default, no code is added to the SWF to register the embedded font classes once it's loaded. This behaviour can be changed in the settings panel, where a few features can be configured. If you select to 'Auto-register fonts in generated classes' - code will be added to register the fonts in the constructor of the SWF document class.
All changes to the application settings are saved and retained from one session to the next. The path to your Flex SDK is also stored once it has been configured successfully.
The lovely splash-screen and application icons were designed by the team here at MadeByPi and, along with looking nice, it lists some application details, and all the open-source code libraries used in the project.
That's about it. Download below, have fun making font SWFs, and feel free to feed back with suggestions or bug reports
Update: v1.004
2 new actions in the glyph input area: Save yourself a bit of time with the new paste and clear buttons - paste in glyphs of your own
Increased UI font size and switched to use system fonts; Arial / Helvetica (_sans)
Update: v1.006
Changed fontName / className behavior to allow the items with the same fontName but different style/weight settings. Thanks to @turbohz for suggesting the improvement
Update: v1.0071
A little update that adds support for .ttc - TrueType Collection - font files.
Update: v1.0072
Fixed handling of non-relative paths to font assets when creating the embed metadata.
![]()












[...] This post was mentioned on Twitter by nicoptere and 16ames iq12, Mike Almond. Mike Almond said: Woo! Finally released FontSwffer: http://j.mp/aK2G87 – Font SWFs made easy
#FontSwffer #FlashDev #AdobeAir [...]
This looks like a nice utility. I wasted the last two days making runtime shared fonts work.
I’ll make a couple of suggestions:
1) Change the pixel font for a real font. It’s too small, by the way.
2) Let us paste in the glyphs field, instead of just displaying the ranges selected on the left (Just as Flash IDE does). This can allow more fine tunning of the ranges we want embedded.
Hope this app gets further developed, as it looks like it can be a real time saver!
TurboHz:
Thanks for the feedback.
I’ll look into adding paste support to the glyph ranges, for now you can actually create your own ranges by pasting glyphs into the customRanges.xml, in the application directory (and restart the app).
As for the font, it’s the default used in the minimalcomps library. I’m happy with it’s appareance, but if there’s sufficient demand, and/or strained eyes, I’ll look for an aleternate.
I second the request to change UI font from the pixel font to something more common, like Arial
While you’re being helpful… you know what would be really great? There are two or three different embedders in MXMLC, and one of them– the Batik embedder– seems to have lots of trouble with the counters in the letters of certain fonts.
If you could add a checkbox to fontswffer that allows us to specify which embedder to use, you could map it to the flex config for the project you’re compiling. Or maybe there’s an mxmlc call that does the trick too. Either way, that’d solve all kinds of problems we have here at work.
I’m following closely the progress of this neat utility.
I’ve seen you fullfilled both the requests I made. It’s much appreciated!
I think you’ll need to add an optional field to set the fontName for each font, to allow more flexibility when compiling font families.
Usually, you can choose to set the same fontName (the Embed attribute, not the Class name) for the different font variants (of fontWeight and fontStyle). This is specially useful when working with html textfields and css stylesheets.
But FontSwffer seems to set the fontName attribute automatically, so it’s impossible to use this technique.
Hope this improvement will make it for the next release!
Cheers.
@TurboHz – Thanks for the feedback! It’s great to see it being used.
I’m looking into the fontName issue – it makes sense that you might want the same font name but with different weights/styles. It should be easy enough to implement those changes, so I’ll see if I can get a new release done in the next few days.
Hi MadeByPi,
I would like to try this app but it seems like its broken
FontSwffer 1.0071 (Air 2.5.0.16600)
Wed Oct 27 12:56:40 2010 UTC
…
[FontSwffer] Generate Font SWF
[FontSwffer] Generating FontSWF document class…
[MXMLCCompileProcess] Path to the SDK has been set: C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.1.0.16076
[mxmlc] Loading configuration file C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.1.0.16076\frameworks\flex-config.xml
[mxmlc] C:\Documents and Settings\jozefch\Local Settings\Temp\fla4E84.tmp\Fonts.as(7): col: 3: Error: unable to resolve ‘null’ for transcoding
[Embed(source = "null",
^
[mxmlc] C:\Documents and Settings\jozefch\Local Settings\Temp\fla4E84.tmp\Fonts.as(7): col: 3: Error: Unable to transcode null.
^
Same for me.
But It worked with previous version.
Hmm, this is an odd one. I’ll look into it.
Is there anything special about font you’re trying to embed? Is it on a remote / networked / usb drive?
Yes, I work on a local hard drive but not C:\
I try again with my project save on the desktop (C:\) and It works…
I don’t understand what’s the problem with the other hard drive but it’s good to know… Thanks for the clue
Done with your latest version.
And good job for this, it’s really usefull.
That’s fixed now, thanks to you both for reporting it
Next time you run it you should be prompted to update to 1.0072