@Override
  public @NotNull Font getFont(@Nullable EditorFontType key) {
    synchronized (fonts) {
      if (fonts.isEmpty()) {
        initFonts();
      }

      EditorFontType fontType = Objects.requireNonNullElse(key, EditorFontType.PLAIN);
      Font font = fonts.get(fontType);
      assert font != null : "Font " + fontType + " not found.";
      UISettings uiSettings = UISettings.getInstance();
      if (uiSettings.getPresentationMode()) {
        return font.deriveFont(UISettingsUtils.with(uiSettings).getPresentationModeFontSize());
      }
      return font;
    }
  }
@Override
  public @NotNull Font getFont(@Nullable EditorFontType key)