* is a special size. Rinse and repeat.
*/
LineDimensionsUtils.markTimeline(getClass(), "Beginning measure line");
RegExp regexp = UnicodeUtils.regexpNonAsciiTabOrCarriageReturn;
regexp.setLastIndex(cache.measuredOffset.column);
MatchResult result = regexp.exec(line.getText());
if (result != null) {
double x = 0;
do {
// Calculate any x offset up to this point in the line
ColumnOffset offset = cache.getLastColumnOffsetInCache();
double baseXOffset = smartColumnToX(offset, result.getIndex());
/*
* TODO: we can be smarter here, if i > 1, then this character
* is a mark. We could separate out the RegExp into non-spacing,
* enclosing-marks v. spacing-marks and already know which are supposed
* to be zero-width based on which groups are null.
*/
String match = result.getGroup(0);
for (int i = 0; i < match.length(); i++) {
x = addOffsetForResult(cache, match.charAt(i), result.getIndex() + i, line, baseXOffset);
baseXOffset = x;
}
result = regexp.exec(line.getText());
// we have to ensure we measure through the last zero-width character.
} while (result != null && result.getIndex() < endColumn && x < endX);
}
if (result == null) {
cache.measuredOffset = ColumnOffsetCache.FULLY_MEASURED;
return;