-
Bug
-
Resolution: Fixed
-
P2
-
1.2.0
-
1.2beta4
-
sparc
-
solaris_2.6
-
Verified
The values that are getting returned for the TextLayout.getBlackBoxBounds api are questionable. I'm created a layout with the TimesRoman font size 24 and the getBlackBoxBounds is returning (116.0625, -21.7265625, 86.70703125, 16.640625).
Font f = new Font("TimesRoman",Font.BOLD,24);
TextLayout tls = new TextLayout("TextLayout", f);
g2.setColor(Color.black);
g2.drawString(tls, 10.0f, tls.getAscent() );
g2.draw(tls.getBlackBoxBounds(0, 4));
Rectangle2D r = tls.getBlackBoxBounds(0, 4).getBounds2D();
System.out.println("BoxBounds=( " + r.getX() + "," + r.getY() + "," +
r.getWidth() + "," + r.getHeight() + ")");
Font f = new Font("TimesRoman",Font.BOLD,24);
TextLayout tls = new TextLayout("TextLayout", f);
g2.setColor(Color.black);
g2.drawString(tls, 10.0f, tls.getAscent() );
g2.draw(tls.getBlackBoxBounds(0, 4));
Rectangle2D r = tls.getBlackBoxBounds(0, 4).getBounds2D();
System.out.println("BoxBounds=( " + r.getX() + "," + r.getY() + "," +
r.getWidth() + "," + r.getHeight() + ")");
- relates to
-
JDK-4130434 The Measurement of Text
-
- Closed
-