htmlText 不显示粗体或斜体字体

发布于 2024-08-31 21:03:42 字数 271 浏览 10 评论 0原文

所以我有一个 MovieClip 资源,里面有一个动态文本字段。我将 .fla 导出为 .swc 以在 Flash Builder 4 中使用,并使用代码创建资源实例,从 XML 动态填充文本。

我的问题是,即使我启用了 htmlText,粗体和斜体标签似乎也不起作用。我有一种感觉,因为当我在 Flash CS4 中创建资源时,文本字段让您指定字体以及要使用的字体子集(常规、粗体、倾斜等)。

有没有办法让 htmlText 正确呈现粗体和斜体标签,而不必完全重新考虑我创建所有这些字段的方式?

So I have a MovieClip asset with a dynamic textfield sitting inside of it. I export my .fla as a .swc to use within Flash Builder 4, and create instances of the asset with code, populating the text dynamically from XML.

My issue is that even though I have htmlText enabled, bold and italics tags don't appear to be working. I have a feeling it is because when I created the asset in Flash CS4, the text field makes you specify the font, and the subset of that to use (Regular, Bold, Oblique, etc).

Is there any way to get the htmlText to render bold and italics tags properly without having to completely rethink the way I'm creating all these fields?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

暖树树初阳… 2024-09-07 21:03:42

好的,我找到了一个很好的解决方案,您需要确保嵌入字体的链接设置设置为导出为动作脚本,或者该字体在 SWF 中的某些文本字段中使用,否则,Flash 认为该字体没有被使用并且只是不嵌入它。

Okay I found a good solution, you need to make sure that the Linkage settings for the embedded fonts are set to export for actionscript OR that that font is used in some textfield in the SWF, otherwise, Flash thinks that the font is not being used and just doesn't embed it.

〃安静 2024-09-07 21:03:42

在没有看到您如何格式化 htmlText 的情况下,我猜测您正在尝试使用

<<粗体>且< EM>标签?

我自己在这些方面也遇到了很多麻烦。我通过加载外部样式表并将其应用到 htmlText TextField 解决了大部分问题。然而,有时我不想为一两个斜体或粗体文本实例定义整个样式。

因此,我通过使用 < 找到了一个简单的解决方案跨度>标记并通过 style 属性设置粗体或斜体:

<span style="font-style:italic;">this is italic</span>

希望这有帮助。

Without seeing how you are formatting your htmlText, I am guessing that you are trying to use the

< bold > and < em > tags?

I had a lot of trouble with these myself. I solved the majority of issues by loading an external stylesheet and applying it to the htmlText TextField. However, there were times when I did not want to define an entire style for one or two instances of italic or bold text.

So, I found a simple solution by using the < span > tag and set the bold, or italics through the style property:

<span style="font-style:italic;">this is italic</span>

Hope this helps.

落花浅忆 2024-09-07 21:03:42

我认为值得注意的是,根据文档,Flash 需要旧的 和 标签。

http://livedocs.adobe.com/flash/9.0 /ActionScriptLangRefV3/flash/text/TextField.html#htmlText

I think it's worth noting that Flash wants the old and tags, according to the documentation.

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextField.html#htmlText

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文