FontInfo (float size, boolean useLigatures, FontRenderContext fontRenderContext) { if (myLastFontKey.mySize == size && myLastFontKey.myUseLigatures == useLigatures && Objects.equals(myLastFontKey.myContext, fontRenderContext)) { return myLastFontInfo; } myLastFontKey.mySize = size; myLastFontKey.myUseLigatures = useLigatures; myLastFontKey.myContext = fontRenderContext; FontInfo fontInfo = myFontInfoMap.get(myLastFontKey); if (fontInfo == null) { fontInfo = AppEditorFontOptions.NEW_FONT_SELECTOR ? new FontInfo(myBaseFont, size, useLigatures, fontRenderContext) : new FontInfo(myBaseFont.getName(), size, myBaseFont.getStyle(), useLigatures, fontRenderContext); myFontInfoMap.put(myLastFontKey.clone(), fontInfo); } myLastFontInfo = fontInfo; return fontInfo; }