Fast way to set text format for a range of Text using TLF
- by wezzy
Hi, i have to set the text format for some tokens in a plain text. I'm trying to use the Text Layout Framework to improve the speed of the operation but i've founded that TLF is far slower (10X in my tests) than the old setTextFormat(). For each token i call this function:
public function setTextFormat(format:TextLayoutFormat, begin:int, end:int):void{
var selection:SelectionState = new SelectionState(this._textFlow, begin, end, this._normalFormat);
IEditManager(_textFlow.interactionManager).applyLeafFormat(format, selection);
}
is there any faster and clever way to do this operation ?
Thanks