use of com.intellij.openapi.editor.colors.ModifiableFontPreferences in project intellij-community by JetBrains.
the class EditorColorsSchemeDelegateTest method testSecondaryFontIsAvailable.
public void testSecondaryFontIsAvailable() throws Exception {
FontPreferences globalPrefs = myTestScheme.getFontPreferences();
assertInstanceOf(globalPrefs, ModifiableFontPreferences.class);
((ModifiableFontPreferences) globalPrefs).register("DummyFont", globalPrefs.getSize(globalPrefs.getFontFamily()));
assertEquals(2, globalPrefs.getRealFontFamilies().size());
init("blah", TestFileType.TEXT);
FontPreferences editorPrefs = myEditor.getColorsScheme().getFontPreferences();
assertEquals(2, editorPrefs.getRealFontFamilies().size());
assertEquals("DummyFont", editorPrefs.getRealFontFamilies().get(1));
}
use of com.intellij.openapi.editor.colors.ModifiableFontPreferences in project intellij-community by JetBrains.
the class FontPreferencesImpl method copyTo.
@Override
public void copyTo(@NotNull final FontPreferences preferences) {
if (preferences instanceof ModifiableFontPreferences) {
ModifiableFontPreferences modifiablePreferences = (ModifiableFontPreferences) preferences;
modifiablePreferences.setEffectiveFontFamilies(myEffectiveFontFamilies);
modifiablePreferences.setRealFontFamilies(myRealFontFamilies);
modifiablePreferences.setTemplateFontSize(myTemplateFontSize);
modifiablePreferences.resetFontSizes();
for (String fontFamily : myRealFontFamilies) {
if (myFontSizes.containsKey(fontFamily)) {
modifiablePreferences.setFontSize(fontFamily, myFontSizes.get(fontFamily));
}
}
modifiablePreferences.setUseLigatures(myUseLigatures);
modifiablePreferences.setLineSpacing(myLineSpacing);
}
}
Aggregations