Open t0mmyt opened 9 years ago
Same issue here. XFCE with DPI set to 280, all other applications look fine.
After looking online, the issue seems to be related more generally to Swing, and this is confirmed by other Swing apps that I run and have the same issue, but I cannot tell much more because I am not a Java developer.
OS X seems to have much better support for Java/Swing on HiDPI. On MacBook Retina Protege looks good.
Closing because this is a Java/Swing issue and not a Protege issue.
@matthewhorridge This has been fixed in JDK 9 https://iamnobuna.ga/post/java-hidpi-woes-finally-over
Here are a few potential leads for overcoming this problem (needs to be tested and validated): http://stackoverflow.com/questions/15659044/how-to-set-the-dpi-of-java-swing-apps-on-windows-linux https://superuser.com/questions/988379/how-do-i-run-java-apps-upscaled-on-a-high-dpi-display http://stackoverflow.com/questions/28673127/how-can-i-scale-fonts-on-a-high-resolution-screen Google has many more results...
If anyone can confirm which, if any, of this solution has worked for them for Protégé that would be really great.
Note: The Protégé Look and Feel (L&F) can be set using the Window -> Look & Feel
menu.
Anyone has managed to fix this? I have tried JDK 9, the custom manifest and a few other solutions without any luck
Problem still here
Can this be re-opened?
Sure, reopening this.
Any workaround?
@nlappas @lsarni @louwers please could you take a look at Protege 5.5.0-beta-8 and let me know if this improves things? Thank you.
It has changed but not improved on Windows:
5.2
Beta 5
Beta 8
@lsarni this is really helpful, thanks. What does the class hierarchy look like? Is it still tiny?
Still tiny @matthewhorridge
5.2
Beta 5
Beta 8
@lsarni good to know. Thank you very much for your help. Much appreciated.
I have solved the problem by decrease the resolution of my windows 10 (originally it is 38402160, after changed, it is 1600900)
Adding -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel to run.sh (or CMDLINE env var) solved this for me on Linux
@eyusupov Which Protégé version and JRE version did you use?
@atextor just tried it again.
Starting Protege 4 OWL Editor (Version 4.3.0, Build = 304)
Platform:
Java: JVM 1.8.0_252-b09 Memory: 466M
Language: en, Country: US
Framework: Apache Software Foundation (1.9)
OS: linux (5.6.11.300_fc32_x86_64)
Processor: x86-64
$ /usr/bin/java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
Still works. I edited run.sh like this:
java -Xmx500M -Xms250M \
-server \
-Dlog4j.configuration=file:log4j.xml \
-DentityExpansionLimit=100000000 \
-Dfile.encoding=UTF-8 \
-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel \
-classpath bin/felix.jar:bin/ProtegeLauncher.jar \
org.protege.osgi.framework.Launcher \
@atextor just tried it again.
Starting Protege 4 OWL Editor (Version 4.3.0, Build = 304) Platform: Java: JVM 1.8.0_252-b09 Memory: 466M Language: en, Country: US Framework: Apache Software Foundation (1.9) OS: linux (5.6.11.300_fc32_x86_64) Processor: x86-64 $ /usr/bin/java -version openjdk version "1.8.0_252" OpenJDK Runtime Environment (build 1.8.0_252-b09) OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
Still works. I edited run.sh like this:
java -Xmx500M -Xms250M \ -server \ -Dlog4j.configuration=file:log4j.xml \ -DentityExpansionLimit=100000000 \ -Dfile.encoding=UTF-8 \ -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel \ -classpath bin/felix.jar:bin/ProtegeLauncher.jar \ org.protege.osgi.framework.Launcher \
This does not seem to work on Kubuntu 20.10
Two not-so-perfect solutions:
-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
plus
a) -Dsun.java2d.uiScale=2
, OR
b) export GDK_SCALE=2
For Windows 11 Enterprise 21H2 I found this answer useful: https://superuser.com/a/1207925. From the Protege directory, the jre/bin/java.exe is the file to change the Compatibility settings on. I used the "System (Enhanced)" setting and that seemed to reduce some of the fuzziness of the rendering seen using the "System" setting.
The root cause of this issue seems to be the limitations of the JRE version packaged with Protege Desktop for Windows.
I'm using Wayland, and tried the above methods, but (almost) none made a difference for HiDPI. The only way that made a difference is to use run_scaled
, which it has its own problems as well (e.g. resource consumption, not playing well with my existing scaling configuration, etc).
In particular, run_scaled
basically started a separate X session and started protege within it. It seems setting the scaling factors for protege (-Dsun.java2d.uiScale=2
or export GDK_SCALE=2
) will be combined with my existing scaling factor (for X and Wayland, not sure which), when used with run_scaled
, leading to the UI exceptionally huge.
(As environmental information: my some other Java application would scale correctly with -Dglass.gtk.uiScale=200%
, directly with Wayland. Though it uses JavaFx and Java 14.)
On Linux using Protege 5.6.1, (which comes with its own Java 11 JRE), I have changed the first 1 lines in run.sh
from this
#!/usr/bin/env bash
to this
#!/usr/bin/env bash
export GDK_SCALE=2
and the GUI becomes usable again;
This hack does not fix the GUI scaling problems for 5.5.0 which comes with its own Java 8 (and older GUI libraries?). Protege 5.5.0 is still displayed with tiny fonts.
version 5.6.3 had the same issue in Linux. It can be solved by adding this to the conf file at (I had to create the conf folder) : ~/.Protege/conf/jvm.conf
append=-Dsun.java2d.uiScale=2
And setting window->Look & feel -> Protégé
Cleaner than modifying the run script and it should also survive tool upgrades.
I'm not sure if this counts as a bug or a feature request but Protege is almost unusable on a high resolution screen. If scaling is set in GTK and the GTK "theme" is used then some elements scale but most still do not.
I've attached screenshots of Protege default and GTK. My resolution is 3200x1800 on a 13" screen. WM is Gnome 3.16 with High DPI scaling set to 2.