FontInfo (@NotNull CharSequence text, int start, int end, @JdkConstants.FontStyle int style, @NotNull FontPreferences preferences, FontRenderContext context) { assert 0 <= start && start < end && end <= text.length() : "Start: " + start + ", end: " + end + ", length: " + text.length(); if (end - start == 1) { // fast path for BMP code points return getFontAbleToDisplay(text.charAt(start), style, preferences, context); } int firstCodePoint = Character.codePointAt(text, start); int secondOffset = Character.offsetByCodePoints(text, start, 1); if (secondOffset == end) { // fast path for a single SMP code point return getFontAbleToDisplay(firstCodePoint, style, preferences, context); } char[] tmp = CharArrayUtil.fromSequence(text, secondOffset, end); return getFontAbleToDisplay(firstCodePoint, tmp, 0, tmp.length, style, preferences, context); }