OpenJDK / jdk / jdk
changeset 1733:95c41a86eac9
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 | cbd1ef3625fc |
children | 861400729115 |
files | jdk/src/share/native/sun/font/freetypeScaler.c jdk/test/java/awt/font/TextLayout/TextLayoutBounds.java |
diffstat | 2 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/jdk/src/share/native/sun/font/freetypeScaler.c Tue Oct 28 14:47:14 2008 -0700 +++ b/jdk/src/share/native/sun/font/freetypeScaler.c Wed Oct 29 01:52:22 2008 +0300 @@ -1281,7 +1281,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/jdk/test/java/awt/font/TextLayout/TextLayoutBounds.java Tue Oct 28 14:47:14 2008 -0700 +++ b/jdk/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]"); } } }