-
Bug
-
Resolution: Fixed
-
P4
-
10, 11.0.19, 17.0.7, 20.0.2
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8308390 | 20.0.2 | Jonathan Dowland | P4 | Resolved | Fixed | b06 |
JDK-8308455 | 17.0.8 | Jonathan Dowland | P4 | Resolved | Fixed | b04 |
JDK-8308505 | 11.0.20 | Jonathan Dowland | P4 | Resolved | Fixed | b04 |
Since JDK10, Font.getStringBounds calculates an incorrect width for a
java.awt.font.Font with the TRACKING attribute set to a value other than
0.0.
This is not visibly evident in AWT/Swing, but can be checked by reading/printing
Font.getStringBounds. It's also reproducible in a simple PDF rendering application.
I have reproduced this issue in JDK11, 17 and 21, as well as confirming it is not
present in JDK8 (jdk8u352-b08). I'll attach a reproducer.
See also a small reproducer (PDF renderer) here:
https://github.com/LibrePDF/OpenPDF/issues/796
- backported by
-
JDK-8308390 Font.getStringBounds calculates wrong width for TextAttribute.TRACKING other than 0.0
- Resolved
-
JDK-8308455 Font.getStringBounds calculates wrong width for TextAttribute.TRACKING other than 0.0
- Resolved
-
JDK-8308505 Font.getStringBounds calculates wrong width for TextAttribute.TRACKING other than 0.0
- Resolved
- links to
-
Commit openjdk/jdk11u-dev/608eca15
-
Commit openjdk/jdk17u-dev/f2e837f8
-
Commit openjdk/jdk20u/511ba727
-
Commit openjdk/jdk/6b9b7d1d
-
Review openjdk/jdk11u-dev/1889
-
Review openjdk/jdk17u-dev/1372
-
Review openjdk/jdk20u/81
-
Review openjdk/jdk/13352