Skip to main content
January 20, 2012
Question

Apply embedded fonts to special characters in spark textArea using tlf

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 ::

@11220649-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;

This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

Adobe Employee
January 29, 2012

Please try the code as follows.

(1)

[Embed(mimeType="application/x-font", exportSymbol="GandhariUnicode-Bold", embedAsCFF="true", fontWeight="bold", source="Assets/Fonts/GandhariUnicode-Bold.otf", fontName="gandhariUnicode-Bold")]

var GandhariUnicode-Bold:Class;

var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();

textLayoutFormat.fontLookup = FontLookup.EMBEDDED_CFF;

textLayoutFormat.fontFamily ="gandhariUnicode-Bold";   

textLayoutFormat.renderingMode = RenderingMode.CFF;

textArea.textFlow.hostFormat = textLayoutFormat;

textArea.textFlow.flowComposer.updateAllControllers();

Or (2)

[Embed(mimeType="application/x-font", exportSymbol="GandhariUnicode-Bold", embedAsCFF="true", fontWeight="bold", source="Assets/Fonts/GandhariUnicode-Bold.otf", fontName="gandhariUnicode-Bold")]

var GandhariUnicode-Bold:Class;


textArea.textFlow.fontLookup = FontLookup.EMBEDDED_CFF;

textArea.textFlow.fontFamily ="gandhariUnicode-Bold";   

textArea.textFlow.renderingMode = RenderingMode.CFF;

textArea.textFlow.flowComposer.updateAllControllers();

Translate