Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java 9 on Windows with large fonts

If you set large fonts (for example, 125%, 120 DPI) on Windows, then it looks as if Swing of Java 9 first renders into a smaller image and then scales this image to the screen.

Text is still properly displayed. But 1 pixel lines are times 1 pixel or 2 pixels strong. A diagonal line is stepped. Icons are rasterized.

Are there any command line parameters or API to change this behavior?


Example Edit:

Using MenuSelectionManagerDemo from docs.oracle.com/javase/tutorial/uiswing/examples/components/

enter image description here

like image 500
Horcrux7 Avatar asked Dec 13 '16 09:12

Horcrux7


2 Answers

I ran that Swing MenuSelectionManagerDemo using Java 9 and Windows 10, and the issues you raised appear to be resolved. See the two screen shots below, where I ran with scaling set to 100% and 125% respectively.

As I pointed out in a comment to the OP, it looks like this was resolved by a JDK bug fix several months ago, which I assume was raised by the OP:

https://bugs.openjdk.java.net/browse/JDK-8174845

One other minor point worth noting is that changing the Windows setting from 100% to 125% is a change to "Scale and Layout", and will "Change the size of text, apps and other items". (i.e. It is far more than just a font change, as mentioned in the JDK bug response.)

100%

125%

like image 107
skomisa Avatar answered Sep 29 '22 12:09

skomisa


I found that on Oracle Java 9,10,11,12 and Amazon Corretto Java LTS (jdk 11.0.2_9) and the rasterization problem with icons/pictures are still a valid case and not fixed! Is this bugfix merged to trunk really?

Last version where this problem is not occurred is Java 8.0_202 where still everything goes well.

like image 25
Csaba Tenkes Avatar answered Sep 29 '22 13:09

Csaba Tenkes