mx 组件内的 Spark 项目不会渲染嵌入字体

发布于 2024-10-14 23:42:05 字数 929 浏览 3 评论 0原文

我最近将 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;
}

我已经尝试了 Adob​​e 提供的一个基本示例,并且该示例工作正常很好,但是在我的复杂项目中,它不起作用。我没有收到任何错误,但它不是使用 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 技术交流群。

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

发布评论

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

评论(1

爱已欠费 2024-10-21 23:42:05

如果您的组件是 MX (Halo),则您希望 embedAsCFF 为 false。

对于 Spark 组件,您可以 embedAsCFF: true。

另外,我不确定您的高级抗锯齿是否正确。

Spark 示例:

@font-face
{
    font-family: "Myriad Web Pro";
    src: url("./assets/fonts/MyriadWebPro.ttf");
    font-weight: normal;
    embedAsCFF: true;  /* Spark */
    advancedAntiAliasing: true;
    unicodeRange: 
        U+0041-U+005A, /* Upper-Case [A..Z] */
        U+0061-U+007A, /* Lower-Case a-z */
        U+0030-U+003F, /* Numbers [0..9] */
        U+0020-U+002F, /* Space + Punctuation [ !"#$%&'()*+,-./ ] */
        U+003A-U+0040; /* Special Chars [ :;?@ ] */
}

MX Halo 示例:

@font-face
{
    font-family: "Myriad Web Pro";
    src: url("./assets/fonts/MyriadWebPro.ttf");
    font-weight: normal;
    embedAsCFF: false;  /* Halo */
    advancedAntiAliasing: true;
    unicodeRange: 
        U+0041-U+005A, /* Upper-Case [A..Z] */
        U+0061-U+007A, /* Lower-Case a-z */
        U+0030-U+003F, /* Numbers [0..9] */
        U+0020-U+002F, /* Space + Punctuation [ !"#$%&'()*+,-./ ] */
        U+003A-U+0040; /* Special Chars [ :;?@ ] */
}

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:

@font-face
{
    font-family: "Myriad Web Pro";
    src: url("./assets/fonts/MyriadWebPro.ttf");
    font-weight: normal;
    embedAsCFF: true;  /* Spark */
    advancedAntiAliasing: true;
    unicodeRange: 
        U+0041-U+005A, /* Upper-Case [A..Z] */
        U+0061-U+007A, /* Lower-Case a-z */
        U+0030-U+003F, /* Numbers [0..9] */
        U+0020-U+002F, /* Space + Punctuation [ !"#$%&'()*+,-./ ] */
        U+003A-U+0040; /* Special Chars [ :;?@ ] */
}

MX Halo Example:

@font-face
{
    font-family: "Myriad Web Pro";
    src: url("./assets/fonts/MyriadWebPro.ttf");
    font-weight: normal;
    embedAsCFF: false;  /* Halo */
    advancedAntiAliasing: true;
    unicodeRange: 
        U+0041-U+005A, /* Upper-Case [A..Z] */
        U+0061-U+007A, /* Lower-Case a-z */
        U+0030-U+003F, /* Numbers [0..9] */
        U+0020-U+002F, /* Space + Punctuation [ !"#$%&'()*+,-./ ] */
        U+003A-U+0040; /* Special Chars [ :;?@ ] */
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文