void (final @NotNull FontPreferences preferences) { if (preferences instanceof ModifiableFontPreferences modifiablePreferences) { modifiablePreferences.setEffectiveFontFamilies(myEffectiveFontFamilies); modifiablePreferences.setRealFontFamilies(myRealFontFamilies); modifiablePreferences.setTemplateFontSize(myTemplateFontSize); modifiablePreferences.resetFontSizes(); for (String fontFamily : myRealFontFamilies) { if (myFontSizes.containsKey(fontFamily)) { modifiablePreferences.setFontSize(fontFamily, myFontSizes.getFloat(fontFamily)); } } modifiablePreferences.setUseLigatures(myUseLigatures); modifiablePreferences.setLineSpacing(myLineSpacing); modifiablePreferences.setRegularSubFamily(myRegularSubFamily); modifiablePreferences.setBoldSubFamily(myBoldSubFamily); } }