Skip to content

Commit bb7cbef

Browse files
committed
Fix font anti-alias on windows
The properties: System.setProperty("awt.useSystemAAFontSettings", "on"); System.setProperty("swing.aatext", "true"); actually works on Linux (where the hint helps X11 to enable antialiased rendering) but makes things worse on Windows where the outcome is exactly the opposite (anti-alias is disabled). Previously those settings had no effect because they were executed *after* the initialization of the graphics. This is no more true after the merge of arduino#5578, that moved the graphics initialization after commmand line parsing and consequently revealed the weird behaviour on windows. Fix arduino#5750
1 parent da97506 commit bb7cbef

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Diff for: app/src/processing/app/Base.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,16 @@ public class Base {
120120
private final List<JMenuItem> recentSketchesMenuItems = new LinkedList<>();
121121

122122
static public void main(String args[]) throws Exception {
123-
System.setProperty("awt.useSystemAAFontSettings", "on");
124-
System.setProperty("swing.aatext", "true");
123+
if (!OSUtils.isWindows()) {
124+
// Those properties helps enabling anti-aliasing on Linux
125+
// (but not on Windows where they made things worse actually
126+
// and the font rendering becomes ugly).
127+
128+
// Those properties must be set before initializing any
129+
// graphic object, otherwise they don't have any effect.
130+
System.setProperty("awt.useSystemAAFontSettings", "on");
131+
System.setProperty("swing.aatext", "true");
132+
}
125133
System.setProperty("java.net.useSystemProxies", "true");
126134

127135
if (OSUtils.isMacOS()) {

Diff for: build/shared/revisions.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
ARDUINO 1.8.1
22

3+
[ide]
4+
* Fixed font rendering not anti-aliased on Windows (regression)
35

46
ARDUINO 1.8.0 - 2016.12.20
57

0 commit comments

Comments
 (0)