来自TLF TextLine的数据

问题描述

| 我在利用TLF时遇到一些问题,我需要解析文本并为文本字段内的每个字符获取x和y。这是我到目前为止所拥有的... 从TextFlow获取每个TextLine:
if (textflow.flowComposer) {
    for (var i:int = 0; i < textflow.flowComposer.numLines; i++) {
         var flowLine:TextFlowLine = textflow.flowComposer.findLineAtPosition(i);
         var textLine:TextLine = flowLine.getTextLine(true);
    }
}
为TextLine获取每个\“ atom \”:
var charPosition:int = textLine.textBlockBeginIndex;
while (charPosition < textLine.textBlockBeginIndex + textLine.rawTextLength) {
    var atomIndex:int = textLine.getAtomIndexAtCharIndex(charPosition);
    textLine.getAtomBounds(atomIndex);
    charPosition = textLine.getAtomTextBlockEndindex(atomIndex);
}
这适用于获取每个字符的边界,但是我仍然需要更多数据,例如它是什么字符以及它的字体大小,字体?在执行textLine.dump()时;我认为我正在获取此数据而不是角色,我得到了一个叫做女巫的东西,它似乎指向正在使用的角色,但我不知道该如何获得确切的角色。有想法吗?     

解决方法

        在TLF的Adobe论坛上,借助Jin-Huang解决了我的问题。我还没有完全尝试过它,但是现在看来可以使用了。