// Look in subsequent text items.
remainingOffset = offset - (charArray.length() - 1 - index);
CharacterSequence4a nextFOText =
this.getNextContiguousTextInBlock();
while (nextFOText != null) {
final CharVector nextText =
nextFOText.getPreTextTransformText(context);
if (nextText.length() >= remainingOffset) {
return nextText.charAt(remainingOffset - 1);
}
remainingOffset -= nextText.length();
nextFOText = nextFOText.getNextContiguousTextInBlock();
}
return 0x0000;
}
// Remaining case has the text in some previous FOText node
remainingOffset = offset + index;
CharacterSequence4a prevFOText =
this.getPreviousContiguousTextInBlock();
while (prevFOText != null) {
final CharVector prevText = prevFOText.getPreTextTransformText(context);
if (prevText.length() >= Math.abs(remainingOffset)) {
return prevText.charAt(prevText.length() + remainingOffset);
}
remainingOffset += prevText.length();
prevFOText = prevFOText.getPreviousContiguousTextInBlock();
}
return 0x0000;
}