You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by eb...@apache.org on 2023/06/02 19:56:58 UTC
[netbeans] branch master updated: Enable sub-pixel anti-aliasing for the splash screen progress text.
This is an automated email from the ASF dual-hosted git repository.
ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new c556867ded Enable sub-pixel anti-aliasing for the splash screen progress text.
c556867ded is described below
commit c556867dedd6280a2814ae7e076536fc2a1f4de1
Author: Eirik Bakke <eb...@ultorg.com>
AuthorDate: Sat Jan 21 22:36:16 2023 -0500
Enable sub-pixel anti-aliasing for the splash screen progress text.
---
.../src/org/netbeans/core/startup/Splash.java | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/platform/core.startup/src/org/netbeans/core/startup/Splash.java b/platform/core.startup/src/org/netbeans/core/startup/Splash.java
index c9985ca2cb..1338029986 100644
--- a/platform/core.startup/src/org/netbeans/core/startup/Splash.java
+++ b/platform/core.startup/src/org/netbeans/core/startup/Splash.java
@@ -27,7 +27,9 @@ import java.awt.image.BufferedImage;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.Locale;
+import java.util.Map;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.util.StringTokenizer;
@@ -643,8 +645,7 @@ public final class Splash implements Stamps.Updater {
image.paintIcon(comp, graphics, 0, 0);
}
// turn anti-aliasing on for the splash text
- graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
- RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+ configureDefaultRenderingHints(graphics);
if (versionBox != null) {
String buildNumber = System.getProperty("netbeans.buildnumber");
@@ -676,6 +677,18 @@ public final class Splash implements Stamps.Updater {
}
}
+ /* A simplified version of org.openide.awt.GraphicsUtils.configureDefaultRenderingHints. (We
+ can't use the org.openide.awt module here.) */
+ public static void configureDefaultRenderingHints(Graphics2D graphics) {
+ Map<Object,Object> ret =
+ (Map) (Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints"));
+ if (ret == null) {
+ ret = new HashMap<Object,Object>();
+ ret.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+ }
+ graphics.addRenderingHints(ret);
+ }
+
private static class SplashDialog extends JDialog implements ActionListener {
/** generated Serialized Version UID */
static final long serialVersionUID = 5185644855500178404L;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists