Search code examples
actionscript-3fontsflashembedding

As3 font embedding


I have seen lots of questions related to font embedding in flash and I can't seem to find an answer to my problem.

I load fonts from a font swf and register them at a high level so that they can be used in child swfs. The issue is the child swf might also embed these fonts, but not explicitly so, meaning they are only embedded because there are fields in the child swf that use certain characters of a font. This means the text fields in the child use the incomplete embedded font instead of the embedded complete set that is registered in the parent or any level of grandparent. Also this means the swfs that may become children of this child won't get the complete font.

My question: Is there any way to tell flash at compile to not embed, under any circumstances, fonts into a swf? If not is there a tool that removes embedded fonts from a compiled swf?

Here's a few things I have given thought to/noticed so far:

  • It seems as if each Font class is tied to an ApplicationDomain. ( Confirmation of this would be helpful )
  • Using device fonts on text fields will not cause any fonts to embed. ( Not an option for me however because I need the fields to embed fonts at runtime from a parent swf. )
  • I can't find a way to unregister fonts or simply tell loaded child swfs to use parent fonts, which would be useful to apply to the loaded child swfs.
  • It may be possible to load the child in a different context that would allow parent definitions of a fonts to override the child definitions. ( Or would there be two definitions and if so which one takes priority? )
  • Loading assets from the library of the child and adding them to the stage will get the parent definition of the font. ( this makes sense because the asset is created outside the domain of the child )
  • A possible solution might be to not add any characters to the textfields for compile of the swf, but this isn't really an option either because I need static text using any font.

I've started forming a definition of what the problem is in my mind that may be incorrect, so please if necessary take a few steps back and give me a different perspective on the problem. So far it seems like the question I asked above is the right question to answer and if there is a solution to it, all my problems go away.

Thanks!


Solution

  • Turns out this is an bug with my version of Flash Professional. I did an update and runtime shared fonts are now possible. I will probably point the shared font at a bad url for the fonts then the fonts will come from the parent application domain because they aren't compiled into the child swfs. I'm using Flash Professional CS5.5 11.5.1 now. I was using CS5.5 11.5.0.

    http://forums.adobe.com/message/3926344

    Thanks Adobe for wasting my time.