FontInfo (int codePoint, char[] remainingText, int start, int end, float size, @JdkConstants.FontStyle int style, boolean useLigatures, FontRenderContext context) { if (style < 0 || style > 3) style = Font.PLAIN; synchronized (lock) { FallBackInfo fallBackInfo = UNDISPLAYABLE_FONT_INFO; IntSet undisplayableChars = ourUndisplayableChars[style]; if (!undisplayableChars.contains(codePoint)) { boolean canDisplayFirst = false; LinkedHashMap<String, FallBackInfo> usedFonts = ourUsedFonts[style]; final Collection<FallBackInfo> descriptors = usedFonts.values(); for (FallBackInfo info : descriptors) { if (info.myOriginalStyle == style && info.canDisplay(codePoint, false)) { canDisplayFirst = true; if (remainingText == null || info.myBaseFont.canDisplayUpTo(remainingText, start, end) == -1) { fallBackInfo = info; break; } } } if (fallBackInfo == UNDISPLAYABLE_FONT_INFO) { List<String> fontNames = ourFontNames[style]; for (int i = 0; i < fontNames.size(); i++) { String name = fontNames.get(i); FallBackInfo info = new FallBackInfo(name, style, style); if (info.canDisplay(codePoint, false)) { canDisplayFirst = true; if (remainingText == null || info.myBaseFont.canDisplayUpTo(remainingText, start, end) == -1) { usedFonts.put(name, info); fontNames.remove(i); fallBackInfo = info; break; } } } if (fallBackInfo == UNDISPLAYABLE_FONT_INFO && !canDisplayFirst) { undisplayableChars.add(codePoint); } } } return fallBackInfo.getFontInfo(size, useLigatures, context); } }