eirikbakke commented on code in PR #5161:
URL: https://github.com/apache/netbeans/pull/5161#discussion_r1059186605


##########
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:
   I updated the comment to change "[Java/AWT/Swing will correctly detect text 
anti-aliasing settings on GNOME, but] not on KDE" to "not (always) on KDE".



-- 
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

Reply via email to