6761856: OpenJDK: vertical text metrics may be significanly different from those returned by Sun JDK
Reviewed-by: bae, prr
This commit is contained in:
parent
285a7ec5e3
commit
df32a451da
@ -1281,7 +1281,7 @@ Java_sun_font_FreetypeFontScaler_getGlyphOutlineBoundsNative(
|
||||
sunFontIDs.rect2DFloatClass,
|
||||
sunFontIDs.rect2DFloatCtr4,
|
||||
F26Dot6ToFloat(bbox.xMin),
|
||||
F26Dot6ToFloat(bbox.yMax),
|
||||
F26Dot6ToFloat(-bbox.yMax),
|
||||
F26Dot6ToFloat(bbox.xMax-bbox.xMin),
|
||||
F26Dot6ToFloat(bbox.yMax-bbox.yMin));
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
||||
*/
|
||||
/* @test
|
||||
* @summary verify TextLayout.getBounds() return visual bounds
|
||||
* @bug 6323611
|
||||
* @bug 6323611 6761856
|
||||
*/
|
||||
|
||||
import java.awt.*;
|
||||
@ -39,10 +39,15 @@ public class TextLayoutBounds {
|
||||
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]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user