TurboVNC / turbovnc

Main TurboVNC repository
https://TurboVNC.org
GNU General Public License v2.0
788 stars 141 forks source link

support: Optimal display settings for text output on high resolution (4k) display #267

Closed r10r closed 3 years ago

r10r commented 3 years ago

Hi,

i've a 4k monitor attached to my macbook. Using TurboVNC I noticed that the terminal output is a (tiny) bit blurry and not as sharp as with another VNC viewer (RealVNC Viewer 6.21.118 x64). I did not change the default display settings. Yes I'm spoiled with sharp graphics and just curious if there are any option to make the output sharper?
(I did set all Encoding options to 'best' but that doesn't change anything here)

Screenshot 2021-02-04 at 01 35 57

Btw. sorry for opening a ticket for that ;)

dcommander commented 3 years ago

It's all good. GitHub issues can be used for general support as well as bug reports.

I'm wondering if this is the same issue described in #254. From Terminal, can you try setting JAVA_TOOL_OPTIONS=-Dsun.java2d.uiScale.enabled=false and then launching the TurboVNC Viewer using /opt/TurboVNC/bin/vncviewer &? (This assumes that you're using Java >= 9.)

r10r commented 3 years ago

Thanks for the fast answer and pointing to the java system properties. I had an old JDK so I installed openjdk15

Unfortunately

try setting JAVA_TOOL_OPTIONS=-Dsun.java2d.uiScale.enabled=false

did not help.

After some googling I spotted a stackoverflow thread How to fix scaling of a java-based application on a high dpi display in linux? suggesting to set JAVA_TOOL_OPTIONS=-Dsun.java2d.uiScale=2.0 which worked fine.

You can now rename TurboVNC to TurboSharpVNC :D

Screenshot 2021-02-05 at 00 41 12

For anyone doing this on macOS 11.x. The settings can be persisted in /etc/launchd.conf

# Set environment variables here so they are available globally to all apps
# (and Terminal), including those launched via Spotlight.
#
# After editing this file run the following command from the terminal to update
# environment variables globally without needing to reboot.
# NOTE: You will still need to restart the relevant application (including Terminal) to pick up the changes!
# grep -E "^setenv" /etc/launchd.conf | xargs -t -L 1 launchctl
#
# See http://www.digitaledgesw.com/node/31
# and http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x/
#
# Note that you must hardcode the paths below, don't use environment variables.
# You also need to surround multiple values in quotes.
#
#
# output from `/usr/libexec/java_home`
#setenv JAVA_HOME /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
setenv JAVA_HOME /Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home
setenv JAVA_TOOL_OPTIONS -Dsun.java2d.uiScale=2.0
dcommander commented 3 years ago

Awesome. Thanks for sharing the solution!