4k resolution - not DPI aware

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

4k resolution - not DPI aware

DrSnake
Hello,

I am running your hardware simulator on a 4k display and it looks like your simulator claims that it is DPI aware, which it is not. Because of this windows doesnt scale the application and looks of course way too tiny too work with.

Is there a fix for this bug coming or a workaround without using a differnt PC of course?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: 4k resolution - not DPI aware

ivant
Hi. I don't think that anybody is working officially on the software suite anymore. But it's an open source software, so you can contribute. I maintain an unofficial version based on the latest official source plus some improvements at https://github.com/itoshkov/nand2tetris-emu.

I don't have access to HiDPI computer (PC or Mac) so it would be hard for me to implement a fix. But I'd be happy to include one. Just fire a pull request :)

Cheers,
Ivan
mk
Reply | Threaded
Open this post in threaded view
|

Re: 4k resolution - not DPI aware

mk
Is there a fix available now?  I have Windows 10 and so have the same problem.
Reply | Threaded
Open this post in threaded view
|

Re: 4k resolution - not DPI aware

ivant
There may be. Java 9 includes HiDPI support and it should just work. So, first grab and install Java 9 and then run the tools from the suite.

Please tell us if it works or not.
Reply | Threaded
Open this post in threaded view
|

Re: 4k resolution - not DPI aware

cadet1620
Administrator
Copied from the Coursera forum:

Has anyone managed to get the Java application to launch with a decent resolution on Windows 10? It's nearly impossible to see on my screen.
______________________________

Windows 10 solution
(from https://superuser.com/questions/988379/how-do-i-run-java-apps-upscaled-on-a-high-dpi-display)

Just found an easy solution on my Windows 10 machine:

    Find javaw.exe you installed.
    Right click -> Properties
    Go to Compatibility tab
    Check Override high DPI scaling behavior.
    Choose System for Scaling performed by:
______________________________

Linux solution

The solution for Windows was editing the properties of javaw.exe, as described above, then restarting the application.

The solution for (Arch) Linux is editing the HardwareSimulator.sh script [and others] as described here:

https://wiki.archlinux.org/index.php/HiDPI#Java_applications

Change the run line:
java -Dsun.java2d.uiScale=2 -classpath ...
Reply | Threaded
Open this post in threaded view
|

Re: 4k resolution - not DPI aware

craftyguy
cadet1620 wrote
The solution for (Arch) Linux is editing the HardwareSimulator.sh script [and others] as described here:
That seems to have no effect for me (Arch Linux, w/ OpenJDK 8). I'm curious if it has worked for others here.
Reply | Threaded
Open this post in threaded view
|

Re: 4k resolution - not DPI aware

ivant
I just played with this a bit. It looks like you need Java 11 for this (9 and 10 are short-term releases, which already expired).

And you don't need to pass these options at all. All you need is to set the GDK_SCALE environment variable, like this:

env GDK_SCALE=2 ./HardwareSimulator.sh

And if you're with a HiDPI monitor, you should be able to set this globally from your system settings.
Reply | Threaded
Open this post in threaded view
|

Re: 4k resolution - not DPI aware

shidaway
In reply to this post by cadet1620
Windows 10

Do I have to restart the computer?
Thanks for your help! Unfortunately, the Windows 10 recipe didn't change anything on my Win10, even though I just updated Java.