@Override public void setEditorFontName(String fontName) { int editorFontSize = getEditorFontSize(); myFontPreferences.clear(); myFontPreferences.register(fontName, editorFontSize); initFonts(); }
private static void readFontSettings( @NotNull Element element, @NotNull FontPreferences preferences, boolean isDefaultScheme) { List children = element.getChildren(OPTION_ELEMENT); String fontFamily = null; int size = -1; for (Object child : children) { Element e = (Element) child; if (EDITOR_FONT_NAME.equals(e.getAttributeValue(NAME_ATTR))) { fontFamily = getValue(e); } else if (EDITOR_FONT_SIZE.equals(e.getAttributeValue(NAME_ATTR))) { try { size = Integer.parseInt(getValue(e)); if (isDefaultScheme) { size = JBUI.scale(size); } } catch (NumberFormatException ex) { // ignore } } } if (fontFamily != null && size > 1) { preferences.register(fontFamily, size); } else if (fontFamily != null) { preferences.addFontFamily(fontFamily); } }
protected void initFonts() { String consoleFontName = getConsoleFontName(); int consoleFontSize = getConsoleFontSize(); myFontPreferences.clear(); myFontPreferences.register(consoleFontName, consoleFontSize); myFontsMap = new EnumMap<EditorFontType, Font>(EditorFontType.class); Font plainFont = new Font(consoleFontName, Font.PLAIN, consoleFontSize); Font boldFont = new Font(consoleFontName, Font.BOLD, consoleFontSize); Font italicFont = new Font(consoleFontName, Font.ITALIC, consoleFontSize); Font boldItalicFont = new Font(consoleFontName, Font.BOLD | Font.ITALIC, consoleFontSize); myFontsMap.put(EditorFontType.PLAIN, plainFont); myFontsMap.put(EditorFontType.BOLD, boldFont); myFontsMap.put(EditorFontType.ITALIC, italicFont); myFontsMap.put(EditorFontType.BOLD_ITALIC, boldItalicFont); }
@Override public void setConsoleFontSize(int fontSize) { myConsoleFontPreferences.register(getConsoleFontName(), fontSize); initFonts(); }
@Override public void setConsoleFontName(String fontName) { int consoleFontSize = getConsoleFontSize(); myConsoleFontPreferences.clear(); myConsoleFontPreferences.register(fontName, consoleFontSize); }
@Override public void setEditorFontSize(int fontSize) { myFontPreferences.register(getEditorFontName(), fontSize); initFonts(); }