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


##########
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 also did one more experiment just now, confirming that the JDK does _not_ 
by itself detect AA settings just because Xft.rgba is present. So I don't know 
the exact conditions in which the JDK would be able to detect AA settings by 
itself on KDE, other than NickLion's report from openSUSE Tumbleweed with KDE 
Plasma.)



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