Flex / Flash:如何在多个 SWC 中嵌入相同的字体

发布于 2024-07-23 01:35:15 字数 338 浏览 4 评论 0原文

我有以下项目结构: - Flex 项目 (SDK 3.3) - 多个带有图形和文本字段的 SWC,用作 Flex 项目中的组件。

由于我有很多 SWC 在动态文本字段中都使用相同的字体,因此我不想在每个 SWC 中嵌入该字体。 相反,我想要一个包含所有 SWC 加载字体的字体的库(RSL?)。

我尝试使用 Flash 中的“导出运行时共享”功能来构建包含字体的库文件。 虽然当我留在 Flash 中时它工作得很好,但当我尝试在 Flex 中使用这些 SWC 时,Flex 会抛出“内部构建错误”。

关于加载字体的好策略有什么想法吗?

多谢, 科尔特

I have the following project structure:
- A Flex Project (SDK 3.3)
- Multiple SWCs with grafics and textfields that are used as components in the Flex project.

Since I have a lot of SWCs that all use the same font in dynamic textfields, I do not want to embed the font in every SWC.
Instead I want to have a library (RSL?) with the font from where all the SWCs load the font.

I tried to build a library file with the fonts using the "Export for runtime sharing" feature in Flash.
While it works perfectly when I stay in Flash, Flex throws an "internal build error" when I try to use these SWCs in Flex.

Any ideas for a good strategy to load the fonts?

Thanks a lot,
Kolt

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

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

发布评论

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

评论(1

马蹄踏│碎落叶 2024-07-30 01:35:15

我过去所做的是使用 flash 创建带有嵌入字体的 swf 文件。 如果您不熟悉,请参阅确定我的意思)该链接还提供了您可能会发现有用的其他信息,它不是我试图找到的链接,但它涵盖了必要的信息。

一旦您拥有了 SWF 字体,您就可以在每个项目中重复使用它。 它不是一个swc,但它与字体的目的一样好。 我已经使用 CS3 来执行此操作(我在尝试 CS4 的试用时提到了这一点,我认为它们可能改变了您创建嵌入字体 swf 的方式)

内容在 CSS 文件中引用字体 swf

@font-face
{
  src: url("../theFolderWhereTheFileIs/YourFontFile.swf");
  fontFamily: "NameOfTheFontYouHaveEmbedded";
  font-weight : bold;
} 

您可以使用类似我创建的 为每种类型的字体创建单独的 swf 文件并适当命名,例如 StoneSansSemiBold.swf 或 StoneSansItalic.swf

What I've done in the past was to use flash to create a swf file with the embedded fonts. see this if you're not sure what I mean for this) The link also provides other info you may find useful, its not the link I was trying to find but it covers the necessary.

Once you have your font SWF then you can just reuse this for each project. It's not a swc, but it’s as good as for the purpose of fonts. I've used CS3 to do this (I mention this as I tried the trial of CS4 and I think they may have changed the way you create embedded font swfs)

You can reference the font swf in your CSS file using something like

@font-face
{
  src: url("../theFolderWhereTheFileIs/YourFontFile.swf");
  fontFamily: "NameOfTheFontYouHaveEmbedded";
  font-weight : bold;
} 

I create a separate swf file for each type of font and name it appropriately such as StoneSansSemiBold.swf or StoneSansItalic.swf

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