Fast way to set text format for a range of Text using TLF

Posted by wezzy on Stack Overflow See other posts from Stack Overflow or by wezzy
Published on 2010-01-25T12:40:41Z Indexed on 2010/04/11 5:03 UTC
Read the original article Hit count: 288

Filed under:
|
|
|
|

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

© Stack Overflow or respective owner

Related posts about flex

Related posts about actionscript-3