arithma
arithma

Reputation: 436

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.

Upvotes: 1

Views: 1873

Answers (2)

user2653774
user2653774

Reputation: 21

Maybe this is a too late answer, but I've been looking around for an answer to a similar problem, and I hope this will help someone else.

I had the same problem going on: My visual content is developed using Flash CS6 (published as SWC) and my "player" is developed using Flash Builder 4.7. On mac, everything worked as charm but when I switched to windows, the swc components fonts (Arial, nothing fancy) were slightly different causing visual misalignments.

After tons of days trying to figure out what was the problem I found out that when I added a spark TextInput component in Flex, the swc components went nuts with the fonts. My workaround has been removing all spark text components from the player (flex); Now it works perfectly.

Can't really understand why adding a s:TextInput causes such behaviour or how to prevent it.

Upvotes: 0

divillysausages
divillysausages

Reputation: 8053

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).

Upvotes: 8

Related Questions