eirikbakke commented on code in PR #5161:
URL: https://github.com/apache/netbeans/pull/5161#discussion_r1059170513
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -222,8 +222,29 @@ case "`uname`" in
# information."
#
https://userbase.kde.org/KDE_System_Administration/Environment_Variables
if [ ! -z "$KDE_FULL_SESSION" ] ; then
- echo "Detected KDE; adding awt.useSystemAAFontSettings=on"
- extra_automatic_options="-J-Dawt.useSystemAAFontSettings=on"
+ # Try to detect the correct subpixel antialiasing mode
+ # (https://github.com/apache/netbeans/issues/4228)
+
+ # See https://docs.gtk.org/gtk4/property.Settings.gtk-xft-rgba.html
+ # See
https://docs.oracle.com/javase/7/docs/technotes/guides/2d/flags.html#aaFonts
+ case "`command xrdb -query 2> /dev/null | grep Xft.rgba | cut -d
':' -f2 | xargs`" in
+ rgb)
+
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=lcd_hrgb"
+ ;;
+ bgr)
+
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=lcd_hbgr"
+ ;;
+ vrgb)
+
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=lcd_vrgb"
+ ;;
+ vbgr)
+
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=lcd_vbgr"
+ ;;
+ *)
+
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=on"
+ ;;
+ esac
+ echo "Detected KDE; use explicit setting for font antialiasing
($extra_automatic_options)"
Review Comment:
* First bullet: Correct.
* Second bullet: On these "other KDE systems", the JDK (reportedly) detects
the subpixel antialiasing setting just fine. But the "on" option for
awt.useSystemAAFontSettings actually refers specifically to the greyscale-type
antialiasing. Which is a safe but not fully optimal setting.
> However this probably should be upstreamed to OpenJDK if possible, looks
like mode probing on KDE is lacking a bit behind.
Yes, it's really an old JDK deficiency. Once NetBeans has run with this
patch for a while, I can submit a JDK bug reporting our experience...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists