@@ -58,6 +58,9 @@ public static void setCurrentEditorConsole(EditorConsole console) {
5858 private final DefaultStyledDocument document ;
5959 private final JTextPane consoleTextPane ;
6060
61+ private SimpleAttributeSet stdOutStyle ;
62+ private SimpleAttributeSet stdErrStyle ;
63+
6164 public EditorConsole () {
6265 document = new DefaultStyledDocument ();
6366
@@ -74,7 +77,7 @@ public EditorConsole() {
7477 Font editorFont = PreferencesData .getFont ("editor.font" );
7578 Font actualFont = new Font (consoleFont .getName (), consoleFont .getStyle (), scale (editorFont .getSize ()));
7679
77- SimpleAttributeSet stdOutStyle = new SimpleAttributeSet ();
80+ stdOutStyle = new SimpleAttributeSet ();
7881 StyleConstants .setForeground (stdOutStyle , Theme .getColor ("console.output.color" ));
7982 StyleConstants .setBackground (stdOutStyle , backgroundColour );
8083 StyleConstants .setFontSize (stdOutStyle , actualFont .getSize ());
@@ -84,7 +87,7 @@ public EditorConsole() {
8487
8588 consoleTextPane .setParagraphAttributes (stdOutStyle , true );
8689
87- SimpleAttributeSet stdErrStyle = new SimpleAttributeSet ();
90+ stdErrStyle = new SimpleAttributeSet ();
8891 StyleConstants .setForeground (stdErrStyle , Theme .getColor ("console.error.color" ));
8992 StyleConstants .setBackground (stdErrStyle , backgroundColour );
9093 StyleConstants .setFontSize (stdErrStyle , actualFont .getSize ());
@@ -109,6 +112,18 @@ public EditorConsole() {
109112 EditorConsole .init (stdOutStyle , System .out , stdErrStyle , System .err );
110113 }
111114
115+ public void applyPreferences () {
116+ Font consoleFont = Theme .getFont ("console.font" );
117+ Font editorFont = PreferencesData .getFont ("editor.font" );
118+ Font actualFont = new Font (consoleFont .getName (), consoleFont .getStyle (), scale (editorFont .getSize ()));
119+
120+ StyleConstants .setFontSize (stdOutStyle , actualFont .getSize ());
121+ StyleConstants .setFontSize (stdErrStyle , actualFont .getSize ());
122+
123+ out .setAttibutes (stdOutStyle );
124+ err .setAttibutes (stdErrStyle );
125+ }
126+
112127 public void clear () {
113128 try {
114129 document .remove (0 , document .getLength ());
0 commit comments