void () { String secondaryFont = getExistingNonDefaultFontName(); FontPreferences globalPrefs = AppEditorFontOptions.getInstance().getFontPreferences(); FontPreferences tempCopy = new FontPreferencesImpl(); globalPrefs.copyTo(tempCopy); try { init("blah", PlainTextFileType.INSTANCE); assertInstanceOf(globalPrefs, ModifiableFontPreferences.class); ((ModifiableFontPreferences)globalPrefs).register(secondaryFont, globalPrefs.getSize(globalPrefs.getFontFamily())); LOG.debug(dumpFontPreferences("globalPrefs", globalPrefs)); assertEquals(2, globalPrefs.getRealFontFamilies().size()); ((EditorEx)getEditor()).reinitSettings(); EditorColorsScheme editorScheme = getEditor().getColorsScheme(); assertInstanceOf(editorScheme, DelegateColorScheme.class); EditorColorsScheme delegate = ((DelegateColorScheme)editorScheme).getDelegate(); assertTrue(delegate.isUseAppFontPreferencesInEditor()); FontPreferences delegatePrefs = delegate.getFontPreferences(); assertEquals(globalPrefs.getRealFontFamilies(), delegatePrefs.getRealFontFamilies()); FontPreferences editorPrefs = editorScheme.getFontPreferences(); LOG.debug(dumpFontPreferences("editorPrefs", editorPrefs)); assertEquals(2, editorPrefs.getRealFontFamilies().size()); assertEquals(secondaryFont, editorPrefs.getRealFontFamilies().get(1)); } finally { tempCopy.copyTo(globalPrefs); } }