changeset 57018:d8888ab6c0ec

8229935: [TEST_BUG]: bug8132119.java inconsistently positions text Reviewed-by: serb
author psadhukhan
date Wed, 06 Nov 2019 10:48:10 +0530
parents 119ae24bce3e
children a4ecc45541da
files test/jdk/ProblemList.txt test/jdk/javax/swing/plaf/basic/BasicGraphicsUtils/8132119/bug8132119.java
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/jdk/ProblemList.txt	Tue Nov 05 15:55:46 2019 -0800
+++ b/test/jdk/ProblemList.txt	Wed Nov 06 10:48:10 2019 +0530
@@ -793,7 +793,6 @@
 javax/swing/MultiUIDefaults/4300666/bug4300666.java 7105119 macosx-all
 javax/swing/UITest/UITest.java 8198392 generic-all
 javax/swing/plaf/basic/BasicComboBoxEditor/Test8015336.java 8198394 generic-all
-javax/swing/plaf/basic/BasicGraphicsUtils/8132119/bug8132119.java linux-all
 javax/swing/plaf/metal/MetalLookAndFeel/Test8039750.java 8198395 generic-all
 javax/swing/text/DevanagariEditor.java 8198397 generic-all
 javax/swing/SpringLayout/4726194/bug4726194.java 8198399 generic-all
--- a/test/jdk/javax/swing/plaf/basic/BasicGraphicsUtils/8132119/bug8132119.java	Tue Nov 05 15:55:46 2019 -0800
+++ b/test/jdk/javax/swing/plaf/basic/BasicGraphicsUtils/8132119/bug8132119.java	Wed Nov 06 10:48:10 2019 +0530
@@ -26,6 +26,7 @@
 import java.awt.FontMetrics;
 import java.awt.Graphics2D;
 import java.awt.GraphicsEnvironment;
+import java.awt.RenderingHints;
 import java.awt.font.FontRenderContext;
 import java.awt.font.NumericShaper;
 import java.awt.font.TextAttribute;
@@ -145,6 +146,8 @@
 
         g2.setColor(DRAW_COLOR);
         g2.setFont(comp.getFont());
+        g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+                            RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
 
         FontMetrics fontMetrices = comp.getFontMetrics(comp.getFont());
         float width = BasicGraphicsUtils.getStringWidth(comp, fontMetrices, str);
@@ -159,7 +162,7 @@
         g2.dispose();
 
         float xx = BasicGraphicsUtils.getStringWidth(comp, fontMetrices, "A") +
-                BasicGraphicsUtils.getStringWidth(comp, fontMetrices, "O")/2;
+                BasicGraphicsUtils.getStringWidth(comp, fontMetrices, "O")/2 -  10;
 
         checkImageContainsSymbol(buffImage, (int) xx, underlined ? 3 : 2);
     }