Font (@NotNull String family, @Nullable String regularSubFamily, @Nullable String boldSubFamily, @JdkConstants.FontStyle int style) { Font font = new Font(family, style, 1); if (font.getFamily().equals(Font.DIALOG) && !Font.DIALOG.equals(family)) { // requested family isn't available return new Font(FontPreferences.DEFAULT_FONT_NAME, style, 1); } return font; }