Search code examples
actionscriptflash-cs5flashdevelop

Static Font Embedded in SWC not being used in SWF


A flashdevelop project (compiling with flexsdk 4.5.0) is using assets from various other SWCs. In the main swf, when the assets are added on stage, no text is displaying when a font is set.

I tried both embedding, and not embedding the fonts in the various SWCs, but nothing seems to work yet.

What embedding strategy should I use?

Notes: I am using Classic Textfields, tried embedding and not embedding the fonts in the various SWCs.


Solution

  • Font embedding can take a bit of time to explain, so check out my post about it here: http://divillysausages.com/blog/as3_font_embedding_masterclass

    Simple things to check:

    • Is embedFonts set to true on the TextField?
    • Is your font embedded with embedAsCFF=false? In flex 4.5, it's true, but you only need it to true if you're using Spark components.
    • Are the glyphs that you're looking to use embedded? In flashdevelop, open up the swc (+ button) and see how many glyphs are embedded for the font you're looking for.
    • Is the same font embedded twice in 2 different swf (static textfields count as well). There seems to be a bug with Flash where it'll take the first instance of an embedded font and ignore the rest. For example, if you has SWC A, which had "hello world" in Arial embedded (static textfield, say), then in SWC B, even though it might have the whole font embedded, it'll use the Arial from SWC A (unless SWC B is in another "weight", e.g. bold).