private static void updatePreferences(@NotNull FontPreferencesImpl preferences,
                                          @NotNull String fontName,
                                          float fontSize,
                                          @Nullable Boolean useLigatures,
                                          @NotNull FontPreferences delegatePreferences) {
      preferences.clear();
      preferences.register(fontName, fontSize);
      List<String> families = delegatePreferences.getRealFontFamilies();
      //skip delegate's primary font
      for (int i = 1; i < families.size(); i++) {
        String font = families.get(i);
        preferences.register(font, fontSize);
      }
      preferences.setUseLigatures(useLigatures != null ? useLigatures : delegatePreferences.useLigatures());
      preferences.setRegularSubFamily(delegatePreferences.getRegularSubFamily());
      preferences.setBoldSubFamily(delegatePreferences.getBoldSubFamily());
    }
private static void updatePreferences(@NotNull FontPreferencesImpl preferences,
                                          @NotNull String fontName,
                                          float fontSize,
                                          @Nullable Boolean useLigatures,
                                          @NotNull FontPreferences delegatePreferences)