使用 TextLayoutFormat 将嵌入字体应用于 Spark textArea 中的特殊字符

发布于 2024-12-28 11:04:08 字数 616 浏览 0 评论 0原文

通过将 fontfamily 直接设置为 mxml 中的 textarea,字体将应用于特殊字符。但使用 tlf 并设置 fontfamily 它不适用。

style.css ::

@font-face

{

    src: URL("/Assets/Fonts/GandhariUnicode-Bold.otf");

    fontFamily: "GandhariUnicode-Bold";

    embedAsCFF: true;

}

源代码片段 ::

textArea.textFlow.interactionManager.selectRange(beginIndex, endIndex);

var textLayoutFormat:TextLayoutFormat = getTextLayoutFormat();

textLayoutFormat.fontLookup = FontLookup.EMBEDDED_CFF;

textLayoutFormat.fontFamily ="GandhariUnicode-Bold";    

textLayoutFormat.renderingMode = RenderingMode.CFF;

By setting fontfamily directly to textarea in mxml fonts get applied to special characters. But using tlf and setting fontfamily it does not apply.

style.css ::

@font-face

{

    src: URL("/Assets/Fonts/GandhariUnicode-Bold.otf");

    fontFamily: "GandhariUnicode-Bold";

    embedAsCFF: true;

}

snippet of source code ::

textArea.textFlow.interactionManager.selectRange(beginIndex, endIndex);

var textLayoutFormat:TextLayoutFormat = getTextLayoutFormat();

textLayoutFormat.fontLookup = FontLookup.EMBEDDED_CFF;

textLayoutFormat.fontFamily ="GandhariUnicode-Bold";    

textLayoutFormat.renderingMode = RenderingMode.CFF;

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

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

发布评论

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

评论(2

捂风挽笑 2025-01-04 11:04:09

您是否尝试过仅设置 fontFamily 就这样?还添加正常的字体粗细定义,看看有什么变化。

Have you tried just setting the fontFamily and that's it? Add the normal font weight definition as well and see what changes.

夜血缘 2025-01-04 11:04:08

嵌入字体的行为可能会很奇怪。我看到您使用的是粗体字体,您是否尝试在嵌入字体或/和 TextLayoutFormat 对象时将字体粗细明确设置为粗体?

另外,我发现这个线程可能有用:http://forums.adobe.com/thread/ 635711

Embedded fonts can behave strangely. I see you're using a bold font, have you tried also setting explicitely font weight to bold when embedding you font or/and on the TextLayoutFormat object?

Also, I've found this thread wich migh be useful : http://forums.adobe.com/thread/635711

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