conflict between fonts in swc and external swf
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?
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.
精彩评论