diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index f77d80795..b645a4d50 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -503,10 +503,9 @@ public class Editor extends JFrame implements RunnerListener { } // apply changes to the font size for the editor - //TextAreaPainter painter = textarea.getPainter(); - textarea.setFont(PreferencesData.getFont("editor.font")); - //Font font = painter.getFont(); - //textarea.getPainter().setFont(new Font("Courier", Font.PLAIN, 36)); + Font editorFont = scale(PreferencesData.getFont("editor.font")); + textarea.setFont(editorFont); + scrollPane.getGutter().setLineNumberFont(editorFont); // in case tab expansion stuff has changed // listener.applyPreferences(); diff --git a/app/src/processing/app/EditorConsole.java b/app/src/processing/app/EditorConsole.java index f31a01b00..686fb9014 100644 --- a/app/src/processing/app/EditorConsole.java +++ b/app/src/processing/app/EditorConsole.java @@ -28,6 +28,8 @@ import javax.swing.text.*; import java.awt.*; import java.io.PrintStream; +import static processing.app.Theme.scale; + /** * Message console that sits below the editing area. */ @@ -70,7 +72,7 @@ public class EditorConsole extends JScrollPane { Font consoleFont = Theme.getFont("console.font"); Font editorFont = PreferencesData.getFont("editor.font"); - Font actualFont = new Font(consoleFont.getName(), consoleFont.getStyle(), editorFont.getSize()); + Font actualFont = new Font(consoleFont.getName(), consoleFont.getStyle(), scale(editorFont.getSize())); SimpleAttributeSet stdOutStyle = new SimpleAttributeSet(); StyleConstants.setForeground(stdOutStyle, Theme.getColor("console.output.color")); diff --git a/app/src/processing/app/Theme.java b/app/src/processing/app/Theme.java index c42e5396f..931710342 100644 --- a/app/src/processing/app/Theme.java +++ b/app/src/processing/app/Theme.java @@ -133,6 +133,14 @@ public class Theme { return new Dimension(scale(dim.width), scale(dim.height)); } + static public Font scale(Font font) { + float size = scale(font.getSize()); + // size must be float to call the correct Font.deriveFont(float) + // method that is different from Font.deriveFont(int)! + Font scaled = font.deriveFont(size); + return scaled; + } + static public Rectangle scale(Rectangle rect) { Rectangle res = new Rectangle(rect); res.x = scale(res.x);