JDK-6751621 : TextLayout.getBounds() doesn't account for strike through
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.4.0,6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-09-23
  • Updated: 2010-04-02
  • Resolved: 2009-01-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u12Fixed 7 b43Fixed
Related Reports
Duplicate :  
Description
TextLayout.getBounds() will return a bounds that does not account for
any strike through. This is apparent if the text begins or ends with a space.
This is an oversight and it requires the same treatment as is being given to
an underline.

But underline isn't returning bounds that completely enclose the rendering
either, although its a very small error.

The reason for this is that the rendering is using a BasicStroke and defaulting
to CAP_SQUARE. Although in the cases where it needs to explicitly specify
parameters it chooses the correct CAP_BUTT.

So part of this is to fix the uses of BasicStroke by strike through and
underline to always use CAP_BUTT.

Test case is attached.

Comments
EVALUATION As per description
23-09-2008