@NotNull
 public static FontInfo getFontAbleToDisplay(
     int codePoint, @JdkConstants.FontStyle int style, @NotNull FontPreferences preferences) {
   boolean tryDefaultFont = true;
   List<String> fontFamilies = preferences.getEffectiveFontFamilies();
   FontInfo result;
   //noinspection ForLoopReplaceableByForEach
   for (int i = 0, len = fontFamilies.size();
       i < len;
       ++i) { // avoid foreach, it instantiates ArrayList$Itr, this traversal happens very often
     final String fontFamily = fontFamilies.get(i);
     result =
         doGetFontAbleToDisplay(codePoint, preferences.getSize(fontFamily), style, fontFamily);
     if (result != null) {
       return result;
     }
     tryDefaultFont &= !FontPreferences.DEFAULT_FONT_NAME.equals(fontFamily);
   }
   int size = FontPreferences.DEFAULT_FONT_SIZE;
   if (!fontFamilies.isEmpty()) {
     size = preferences.getSize(fontFamilies.get(0));
   }
   if (tryDefaultFont) {
     result = doGetFontAbleToDisplay(codePoint, size, style, FontPreferences.DEFAULT_FONT_NAME);
     if (result != null) {
       return result;
     }
   }
   result = doGetFontAbleToDisplay(codePoint, size, style);
   if (LOG.isDebugEnabled()) {
     LOG.debug("Fallback font: " + result.getFont().getFontName());
   }
   return result;
 }