I’ve been struggling for a week now trying to find a way to use runtime embedded fonts – Font.registerFont() – for runtime created text fields, but still be able to have author-time created text fields in my projects. There are many issues with this. Here is what I have discovered thus far:[LIST=1]
[]I can successfully load in a font from an external Fonts.swf and use it to create and display text at runtime.
[]There does not seem to be any way to specify the use of that runtime loaded font for an author-time created text field.
[]If I have an author-time created text field on the stage that uses the same font, it completely breaks the use of the runtime loaded font for runtime created text. The way in which this breaks varies depending on the author-time created text field:[LIST=1]
[]If the field is a Static text field, runtime created text using the runtime embedded version of the same font does not appear at all.
[]If the field is dynamic, but does not have its font embedded (using the properties “embed” button), the runtime created text using the runtime embedded version of the same font does not appear at all.
[]If that text field is dynamic and does have its font embedded, it will create a duplicate entry for that font in the Font.enumerateFonts Array. This is a problem, because Flash will then default to using the version of the font embedded in its own .swf (the one from the author-time text field) rather than the one loaded in at runtime… even if the .swf version of the embedded font doesn’t have all of the glyphs required to display the text! So you end up with a runtime created text field that will only display some of its characters.
[/LIST]
[*]When there are duplicates of embedded fonts, I cannot find any way to specify which version to use, because they are all referenced only by the original font name.
[/LIST]It seems utterly ridiculous to me that I have the fonts embedded and ready to be used, but that Flash gets all confused by author-time created text fields and thus makes the use of those embedded fonts for runtime created text impossible. Has anyone out there found a solution to these issues? Specifically:
- Is there a way to specify the use of a runtime embedded font in an author-time created text field?
- If there are duplicate embedded fonts (not really duplicates, but with the same fontName, fontStyle, and fontType… so indistiguishable) is there any way to specify which one a text field should use? If there is, I could do a check on each embedded font for Font.hasGlyphs() until I find the one that works and then specify that version.
Thanks in advance for any thoughts!