File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -503,10 +503,9 @@ public void applyPreferences() {
503503 }
504504
505505 // apply changes to the font size for the editor
506- //TextAreaPainter painter = textarea.getPainter();
507- textarea .setFont (PreferencesData .getFont ("editor.font" ));
508- //Font font = painter.getFont();
509- //textarea.getPainter().setFont(new Font("Courier", Font.PLAIN, 36));
506+ Font editorFont = scale (PreferencesData .getFont ("editor.font" ));
507+ textarea .setFont (editorFont );
508+ scrollPane .getGutter ().setLineNumberFont (editorFont );
510509
511510 // in case tab expansion stuff has changed
512511 // listener.applyPreferences();
Original file line number Diff line number Diff line change 2828import java .awt .*;
2929import java .io .PrintStream ;
3030
31+ import static processing .app .Theme .scale ;
32+
3133/**
3234 * Message console that sits below the editing area.
3335 */
@@ -70,7 +72,7 @@ public EditorConsole() {
7072
7173 Font consoleFont = Theme .getFont ("console.font" );
7274 Font editorFont = PreferencesData .getFont ("editor.font" );
73- Font actualFont = new Font (consoleFont .getName (), consoleFont .getStyle (), editorFont .getSize ());
75+ Font actualFont = new Font (consoleFont .getName (), consoleFont .getStyle (), scale ( editorFont .getSize () ));
7476
7577 SimpleAttributeSet stdOutStyle = new SimpleAttributeSet ();
7678 StyleConstants .setForeground (stdOutStyle , Theme .getColor ("console.output.color" ));
Original file line number Diff line number Diff line change @@ -133,6 +133,14 @@ static public Dimension scale(Dimension dim) {
133133 return new Dimension (scale (dim .width ), scale (dim .height ));
134134 }
135135
136+ static public Font scale (Font font ) {
137+ float size = scale (font .getSize ());
138+ // size must be float to call the correct Font.deriveFont(float)
139+ // method that is different from Font.deriveFont(int)!
140+ Font scaled = font .deriveFont (size );
141+ return scaled ;
142+ }
143+
136144 static public Rectangle scale (Rectangle rect ) {
137145 Rectangle res = new Rectangle (rect );
138146 res .x = scale (res .x );
You can’t perform that action at this time.
0 commit comments