[embed] 标签和字体的问题
我对 [embed] 标签有一些问题。即使我将文本字段的 embedFonts 属性设置为 true,文本也不会显示。
问题是它之前可以工作,但经过一些更改(与字体无关)后就不行了。我想了解字体的嵌入过程如何工作以查找代码中的错误。
我声明:
[Embed(source = 'asset/font.ttf', fontName="font", mimeType="application/x-font-truetype")] private static var font:String;
将字体分配给程序。
然后我在声明我的 textFormat 时调用“font”。 “fontName”属性是与 textformat 的链接吗?
我使用flashdevelop和flex_sdk_4.0.0.14159(大的adobe,带有空气(~140mo))
谢谢!
-腿
I have some issue with the [embed] tag. Even if I set the embedFonts property of the textfield to true the text doesn't show up.
The thing is that it worked previously and after some changes (not related to fonts) it doesn't. I'd like to understand how the embed process for font works to find the error in my code.
I declare :
[Embed(source = 'asset/font.ttf', fontName="font", mimeType="application/x-font-truetype")] private static var font:String;
to assign the font to the program.
Then i call "font" when declaring my textFormat. Is the "fontName" property the link with the textformat ?
I work with flashdevelop and the flex_sdk_4.0.0.14159 (the big adobe one, with air (~140mo))
Thx !
-Leg
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要做到恰到好处可能是一件很棘手的事情。大约 10 天前,我不得不与这个问题作斗争,只有尝试了嵌入的名称和参数的几种组合才能让它工作。
我读过博客报告,其中有一些轶事建议,如果您需要粗体或其他什么,则必须包含 fontStyle。以下是对我有用的咒语:
我不认为
unicodeRange
是绝对必要的,但我不需要整个字体,上面的内容为您提供了 IDE 中“Basic Latin”的等效内容。当我想使用该字体时,我会这样做:
我不敢相信我错过了最重要的部分。直到我强制 mxmlc 编译器使用自定义字体管理器后,上述方法才起作用。
添加以下内容作为编译器选项:
Flex 3 中的字体故障排除列出了可用的字体管理器。尝试它们,直到找到一种有效的方法。
This can be a tricky thing to get just right. I had to fight with this about 10 days ago and only though trying several combinations of names and parameters to the embed could I get it to work.
I read blog reports that had anecdotal advice that you had to include the fontStyle if you need bold or whatnot. Here is the incantation that worked for me:
I don't think
unicodeRange
is strictly necessary but I didn't need the entire font and the above gives you the equivalent of "Basic Latin" in the IDE.When I want to use the font I do so like this:
I can't believe I missed the most important piece. The above didn't work until I forced the mxmlc compiler to use a custom font manager.
Add the following as a compiler option:
There is an Adobe technote on troubleshooting fonts in Flex 3 that lists the available font managers. Try them until you find one that works.
该问题来自 4.0 Flex SDK
http:// opensource.adobe.com/wiki/display/flexsdk/Font+Embedding+Reprise
我设置了与 Flash Player 9(带有 sdk 3.4)的兼容性,它再次工作。
The problem was coming from a modification in the 4.0 Flex SDK
http://opensource.adobe.com/wiki/display/flexsdk/Font+Embedding+Reprise
I set the compatibility to Flash player 9 (with sdk 3.4) and it is working again.