Search in sources :

Example 1 with ModifiableFontPreferences

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));
}
Also used : FontPreferences(com.intellij.openapi.editor.colors.FontPreferences) ModifiableFontPreferences(com.intellij.openapi.editor.colors.ModifiableFontPreferences) ModifiableFontPreferences(com.intellij.openapi.editor.colors.ModifiableFontPreferences)

Example 2 with ModifiableFontPreferences

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);
    }
}
Also used : ModifiableFontPreferences(com.intellij.openapi.editor.colors.ModifiableFontPreferences)

Aggregations

ModifiableFontPreferences (com.intellij.openapi.editor.colors.ModifiableFontPreferences)2 FontPreferences (com.intellij.openapi.editor.colors.FontPreferences)1