3

I have an actionscript 3 based website that is loading font outlines dyncamically, from external font swfs, using a common technique.

... 
var FontLibrary:Class = e.target.applicationDomain.getDefinition("font") as Class;
Font.registerFont(FontLibrary.fontClass);

Everything works fine until I attach assets from an swc containing text with the same font. At which point only the outlines from the swc are used. So for exampe, if the swc has a dyncamic TextField, containing the letters "abc" then only those letters will display in the website and not the entire alphabets that where previously loaded dyncamically from the font swf.

Has anyone encountered this and found a solution?

Sunny
  • 131
  • 1
  • 1
  • 6

1 Answers1

1

I had that problem with embed fonts in Flex and then adding a swf with the same fonts to the project.

Just make sure that the SWC font contains all the characters. Maybe like this: http://www.adobe.com/devnet/flash/quickstart/embedding_fonts.html

Or you could try to set the font of the textfield in the swc programmatically and not via IDE options. So that the font doesn't get embed in the first place in the swc.

thgie
  • 2,367
  • 1
  • 18
  • 28
  • Thanks for the confirmation. To keep things dynamic I do not embed any font outlines in the swc, making sure that each TextField in the the swc has "_san" without embedding and then through actionscript, once an asset is added to the display list, I turn embed on and set the format of each text field. – Sunny Apr 28 '11 at 13:46
  • As long as two font families do not conflict everything seems ok. For example, if Century Gothic is in the assets.swc and Arial is in font.swf everything should be good. But if Century Gothic Italic is in assets.swc and Century Gothic Bold is in font.swf then the assets.swc font will override all Century Gothic outlines no matter what style. – Sunny Apr 28 '11 at 14:30