changeset 301:a24826f1beaa

6761856: OpenJDK: vertical text metrics may be significanly different from those returned by Sun JDK Reviewed-by: bae, prr
author igor
date Wed, 29 Oct 2008 01:52:22 +0300
parents fa2068c8ea20
children 82b80660cac3
files src/share/native/sun/font/freetypeScaler.c test/java/awt/font/TextLayout/TextLayoutBounds.java
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/font/freetypeScaler.c	Tue Feb 16 18:35:16 2010 -0800
+++ b/src/share/native/sun/font/freetypeScaler.c	Wed Oct 29 01:52:22 2008 +0300
@@ -1291,7 +1291,7 @@
                                    sunFontIDs.rect2DFloatClass,
                                    sunFontIDs.rect2DFloatCtr4,
                                    F26Dot6ToFloat(bbox.xMin),
-                                   F26Dot6ToFloat(bbox.yMax),
+                                   F26Dot6ToFloat(-bbox.yMax),
                                    F26Dot6ToFloat(bbox.xMax-bbox.xMin),
                                    F26Dot6ToFloat(bbox.yMax-bbox.yMin));
     }
--- a/test/java/awt/font/TextLayout/TextLayoutBounds.java	Tue Feb 16 18:35:16 2010 -0800
+++ b/test/java/awt/font/TextLayout/TextLayoutBounds.java	Wed Oct 29 01:52:22 2008 +0300
@@ -22,7 +22,7 @@
  */
 /* @test
  * @summary verify TextLayout.getBounds() return visual bounds
- * @bug 6323611
+ * @bug 6323611 6761856
  */
 
 import java.awt.*;
@@ -39,10 +39,15 @@
        Rectangle2D tlBounds = tl.getBounds();
        GlyphVector gv = f.createGlyphVector(frc, s);
        Rectangle2D gvvBounds = gv.getVisualBounds();
+       Rectangle2D oBounds = tl.getOutline(null).getBounds2D();
        System.out.println("tlbounds="+tlBounds);
        System.out.println("gvbounds="+gvvBounds);
+       System.out.println("outlineBounds="+oBounds);
        if (!gvvBounds.equals(tlBounds)) {
-          throw new RuntimeException("Bounds differ");
+          throw new RuntimeException("Bounds differ [gvv != tl]");
+       }
+       if (!tlBounds.equals(oBounds)) {
+          throw new RuntimeException("Bounds differ [tl != outline]");
        }
     }
 }