public static int textWidth(@NotNull Editor editor,
                              @NotNull CharSequence text,
                              int start,
                              int end,
                              @JdkConstants.FontStyle int fontType,
                              int x) {
    int result = 0;
    for (int i = start; i < end; i++) {
      char c = text.charAt(i);
      if (c != '\t') {
        FontInfo font = fontForChar(c, fontType, editor);
        result += font.charWidth(c);
        continue;
      }

      result += nextTabStop(x + result, editor) - result - x;
    }
    return result;
  }
public static int textWidth(@NotNull Editor editor,
                              @NotNull CharSequence text,
                              int start,
                              int end,
                              @JdkConstants.FontStyle int fontType,
                              int x)