JDK-8087793 : Windows scaling override also disables font scaling on HiDPI displays
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8u60
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-05-23
  • Updated: 2015-06-27
  • Resolved: 2015-06-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u60Fixed 9Fixed
Related Reports
Blocks :  
Blocks :  
Relates :  
Description
Various overrides to control or disable UI and rendering scaling on Windows were added as safeguards when the Windows HiDPI support was added to JavaFX under RT-27960. Those controls are sometimes invoked by parts of the system when interacting with modules that don't fully support UI scaling (JFXPanel and SwingNode for instance).

Unfortunately, the font used to scale according to the Windows DPI settings even when we weren't scaling the rest of the UI and when the controls are used to disable our general UI scaling, it leaves us in a situation where we down-scale the fonts as well.  This may or may not be a bad thing since when the fonts are scaled up according to the screen DPI and the rest of the application is not also scaled, layout problems can occur.

This issue is filed to track the problem so that we can document any issues or concerns that may arise due to this new behavior for the system font size.  The final answer may well be "this is working as intended", but we lack data to know what the right thing to do is...
Comments
http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/23be047f521e
27-06-2015

Since the fix to the test is trivial, I filed JDK-8130009 to fix the test. I'll push that today.
26-06-2015

The failing test can be disabled separately or as part of this patch (it won't break smoke tests, so just needs to be disabled some time today).
26-06-2015

+1 OK to take in 8u60
26-06-2015

Looks good. The only problem I noticed in testing is that we now have a new unit test failure in a system test that is doing something it shouldn't do (system tests needs to ensure that the JavaFX runtime is initialized before constructing a scene graph). The reason for the failure is that Text.setText() gets the system font which now needs to get the screen UI scale. That is not valid until after the FX runtime is initialized. This will not cause problems for well-formed applications, and Text joins a long line of other nodes (including all controls) that fail in the same way. I propose that we @Ignore the failing test, and then file a follow-on JIRA, as follows: diff --git a/tests/system/src/test/java/javafx/scene/text/TextNodeTest.java b/tests/system/src/test/java/javafx/scene/text/TextNodeTest.java --- a/tests/system/src/test/java/javafx/scene/text/TextNodeTest.java +++ b/tests/system/src/test/java/javafx/scene/text/TextNodeTest.java @@ -33,7 +33,10 @@ import org.junit.Test; import static org.junit.Assert.*; +import org.junit.Ignore; +// FIXME: Initialize the FX runtime in an @BeforeClass method and then re-enable it +@Ignore("FIXME") public class TextNodeTest { public TextNodeTest() {
26-06-2015

http://cr.openjdk.java.net/~flar/JDK-8087793/webrev.00/
26-06-2015

Depending on what we do with JDK-8129862 we may need to fix this for 8u60. Or we still might close as "Won't fix".
26-06-2015

Target to 9, but we may want to consider this for 8u60.
23-05-2015