Loaded font doesn't show up when parent swf creates textField in loaded child swf
Im working on a project that开发者_如何学Python has a main swf file associated with the document class. It loads XML that provides the text content for the project, then it loads a swf that contains a font in its library, then it loads the first of several content module swfs. When the font swf has inited, I'm registering its library font with Font.registerFont(), and using it in a TextFormat object. After everything is done, I can add code to the document class to create a text field on the stage of the main swf and format it successfully with the TextFormat object, but when I try to do the same thing inside the loaded content module swf, the text doesn't show up there at all. Any help would be appreciated.
I love the difficulty of the question.
Never faced the problem, but first you may verify :
tf.embedFonts = true;
Or can't you simply embed the font with :
[Embed(source = "../bin/Fonts/book.ttf", mimeType = "application/x-font", fontName = "bookEmbed", embedAsCFF = 'false')]
public var font01:Class;
then
embedFonts = true;
defaultTextFormat = new TextFormat("bookEmbed", 20, 0xFFFFFF);
text = questions.questItem[currentQ].questTitle;
(in this order, setting the text before the textformat doesn't worked for me)
Be sure you're using the embedded font's fontName for define your textFormat's font.
精彩评论