int (@NotNull CharSequence text, int start, int end, int xStart, @JdkConstants.FontStyle int fontType, @NotNull Rectangle clip) { int x = xStart; for (int i = start; i < end && xStart < clip.x + clip.width; i++) { char c = text.charAt(i); if (c == '\t') { x = EditorUtil.nextTabStop(x, this); } else { x += EditorUtil.charWidth(c, fontType, this); } if (x > clip.x + clip.width) { break; } } return x - xStart; }