mx 组件内的 Spark 项目不会渲染嵌入字体
我最近将 Flex3 AIR 项目转换为 Flex4,因此它现在使用 Flex4.1 sdk 和
。这是一个大型项目,我们煞费苦心地更新了所有重要的代码,以便与 Flex4 配合使用,现在可以顺利编译。
该项目中的大多数组件都是从基于 mx 的组件演变而来的,因此由于工作量的原因,我还没有将其更新为 Spark。我遇到的问题是,我无法让嵌入字体适用于我现在添加到 mx 组件中的 Spark 组件。
例如,我编辑了我的一个(基于 mx 的)组件并向其中添加了一些项目。我的嵌入字体必须具有 embedAsCFF=false 才能适用于我的 mx 组件。因此,要将此也嵌入到spark中,我应该能够简单地使用 embedAsCFF=true 再次嵌入它,如下所示:
@font-face
{
src: url("assets/fonts/MyriadWebPro.ttf");
font-family: mainWithCFF;
font-style: normal;
font-weight: normal;
font-anti-alias-type: "advanced";
embedAsCFF: true;
}
s|Label{
font-family: mainWithCFF;
}
我已经尝试了 Adobe 提供的一个基本示例,并且该示例工作正常很好,但是在我的复杂项目中,它不起作用。我没有收到任何错误,但它不是使用 MyriadWebPro 的 Spark 组件,而是默认为 Times。
我想知道这是否是因为我的组件是基于 mx 而不是基于 Spark。也许这仅在您在 Spark 组件内使用 mx 组件时才有效?如果是这样,有人知道您有一个 mx 组件并希望在其中有一个 Spark 标签的问题的解决方案吗?
I have recently converted a Flex3 AIR project to Flex4, so it now uses Flex4.1 sdk and <s:WindowedApplication>
. It is a large project and having painstakingly updated all the vital bits of code to work with Flex4 it now happliy compiles.
Most of the components in the project decend over quite a few generations from an mx based component, so I have not yet updated this to spark due to the workload. The problem I am having is that I cannot get the embedded font to work for spark components that I now add to my mx components.
For example, I have edited one of my (mx based) components and added some items to it. My embedded font has to have embedAsCFF=false so that it works for my mx components. So to get this to also embed for spark, I should be able to simply embed it again with embedAsCFF=true as shown below:
@font-face
{
src: url("assets/fonts/MyriadWebPro.ttf");
font-family: mainWithCFF;
font-style: normal;
font-weight: normal;
font-anti-alias-type: "advanced";
embedAsCFF: true;
}
s|Label{
font-family: mainWithCFF;
}
I have tried a basic example of this that Adobe provides and this example works just fine, but in my complex project, it does not work. I do not get any errors, but instead of the spark component using MyriadWebPro it defaults to Times.
I wonder if this is because my component is mx based rather than spark based. Maybe this only works if you are using an mx component inside a spark component? If so does anyone know of a solution to the problem where you have an mx component and want to have a spark Label inside that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的组件是 MX (Halo),则您希望 embedAsCFF 为 false。
对于 Spark 组件,您可以 embedAsCFF: true。
另外,我不确定您的高级抗锯齿是否正确。
Spark 示例:
MX Halo 示例:
If your component is MX (Halo), you want embedAsCFF to be false.
For Spark components, you embedAsCFF: true.
Also, I'm not sure your advanced Anti Aliasing is correct.
Spark Example:
MX Halo Example: