简体   繁体   English

在SWF中加载的字体在SWF中加载的SWF中! 文字消失

[英]font in swf loaded in a swf loaded in swf !!! the text disappear

I've been looking on the net for a response to my problem without success . 我一直在网上寻找对我​​的问题的回应,但没有成功。

I've made a swf containing a font in the library the class name of my font is "MVerdana". 我在库中制作了一个包含字体的swf文件,该字体的类名称为“ MVerdana”。

this swf is loaded in another swf which display a textfield. 该SWF文件会加载到另一个显示文本字段的SWF文件中。 the swf is loaded by a Loader. SWF由加载程序加载。 in the complete event, I'm getting the font class using 在完成事件中,我正在使用

var loaderInfo:LoaderInfo = event.currentTarget as LoaderInfo;
 var app:ApplicationDomain = loaderInfo.applicationDomain;
 fontClass =  app.getDefinition("MVerdana") as Class;
 Font.registerFont(fontClass);

it's working well 运行良好

but... when I load this swf (the one loading the font and displaying a textfield) using a new ApplicationDomain in the context loader, the textfield doesn't show , and I can see that the font is registered when I use Font.enumerateFonts() 但是...当我在上下文加载器中使用新的ApplicationDomain加载此swf(加载字体并显示文本字段的swf)时,该文本字段未显示,并且可以看到使用Font时该字体已注册。 enumerateFonts()

It's working if I load the swf in the currentDomain, but it's not what I want. 如果将swf加载到currentDomain中,则可以正常工作,但这不是我想要的。

I really don't understand what's is going on !!! 我真的不明白发生了什么! can someone help me ? 有人能帮我吗 ?

If I understand correctly you are running into the following bug: 如果我理解正确,那么您会遇到以下错误:

https://bugs.adobe.com/jira/browse/FP-2026?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab https://bugs.adobe.com/jira/browse/FP-2026?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab

I know about this because I did run into the same bug with an application we built while back. 我之所以知道这一点,是因为我确实遇到了我们之前构建的应用程序遇到的同一错误。 We had different SWFs that were loading into a master SWF and each of them would contain a copy of the font. 我们有不同的SWF文件正在加载到主SWF文件中,并且每个SWF文件都包含该字体的副本。 Everything was fine. 一切都很好。 Then we decided to move the font to the master container and then everything broke. 然后我们决定将字体移到主容器中,然后一切都坏了。

The main issue to note here is that if the Child SWF has a textfield on the timeline with the same name as the font that is being embeded in the master SWF then this causes the issue. 这里要注意的主要问题是,如果子SWF在时间轴上具有与嵌入主SWF中的字体同名的文本字段,则将导致此问题。 We didn't run into this before because most of our applications do not rely on the timeline but rather create the textfields dynamically. 我们之前没有遇到过这种情况,因为我们的大多数应用程序都不依赖时间轴,而是动态创建文本字段。 So if you are able to create your textfields dynamically that could be your answer. 因此,如果您能够动态创建文本字段,那可能就是您的答案。 If you have to use the same Font and you have textfields on the timeline the it is going to be a tough one to break until Flash fixes it of course. 如果必须使用相同的Font,并且时间轴上有文本字段,那么在Flash修复它之前,要打破它就很难了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM