int (CharSequence text, int xStart, int fontType) { int start = 0; int x = xStart; for (int i = 0; i < text.length(); i++) { if (text.charAt(i) != '\t') continue; if (i > start) { for (int j = start; j < i; j++) x += charWidth(fontType, text.charAt(j)); } x = nextTabStop(x); start = i + 1; } if (start < text.length()) { for (int j = start; j < text.length(); j++) x += charWidth(fontType, text.charAt(j)); } return x - xStart; }