void () { Font[] allFonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); for (Font font : allFonts) { String name = font.getName(); Integer style = FONT_NAME_TO_STYLE.get(name); if (style == null) { continue; } if (style != Font.PLAIN) { String familyName = font.getFamily(); Pair<String, Integer>[] entry = ourStyledFontMap.get(familyName); if (entry == null) { //noinspection unchecked entry = new Pair[4]; for (int i = 1; i < 4; i++) { entry[i] = Pair.create(familyName, i); } ourStyledFontMap.put(familyName, entry); } entry[style] = Pair.create(name, Font.PLAIN); } } }