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

Posted

技术标签:

【中文标题】使用 TextLayoutFormat 将嵌入字体应用于 spark textArea 中的特殊字符【英文标题】:Apply embedded fonts to special characters in spark textArea using TextLayoutFormat 【发布时间】:2012-02-15 01:57:00 【问题描述】:

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

style.css ::

@font-face



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

    fontFamily: "GandhariUnicode-Bold";

    embedAsCFF: true;


源代码的sn-p ::

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

var textLayoutFormat:TextLayoutFormat = getTextLayoutFormat();

textLayoutFormat.fontLookup = FontLookup.EMBEDDED_CFF;

textLayoutFormat.fontFamily ="GandhariUnicode-Bold";    

textLayoutFormat.renderingMode = RenderingMode.CFF;

【问题讨论】:

【参考方案1】:

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

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

【讨论】:

【参考方案2】:

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

【讨论】:

你设置了fontWeight吗? help.adobe.com/en_US/flex/using/…

以上是关于使用 TextLayoutFormat 将嵌入字体应用于 spark textArea 中的特殊字符的主要内容,如果未能解决你的问题,请参考以下文章

如何使用nuxt js将字体嵌入到所有页面

如何从 C# WPF 中的嵌入字体将字体文件添加到 Stimulsoft 报告

Itext 在 PDF 中嵌入字体

怎么在PDF文档中内嵌入字体

为 AS3 嵌入字体。如何?

Ghost4J/Ghostscript - 尝试将字体嵌入 PDF 时出现错误 100