通过将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;
嵌入式字体的行为可能很奇怪。我看到你使用的是粗体字体,你有没有尝试过在嵌入字体或/和TextLayoutFormat对象时将字体重量明确设置为粗体?
此外,我发现这个线程可能很有用:http://forums.adobe.com/thread/635711
你试过只设置fontFamily吗?添加正常的字体重量定义,看看有什么变化。