RFR: 8377937: [macos] GlyphMetrics advance does not consider font rotation [v2]
Daniel Gredler
dgredler at openjdk.org
Wed Feb 25 12:04:38 UTC 2026
> On macOS, `GlyphMetrics` advance provides only the x-component of the advance, not the y-component. This is usually not an issue, since most text does not have any y-component advance. However, if the font is rotated, this does cause problems.
>
> This bug was discovered during fixing of the manual test `java/awt/print/PrinterJob/PrintTextTest.java` (this test is intended to test printing, but this bug was actually causing the `GlyphVector`s on page 8 to be drawn incorrectly on screen, not just on paper).
>
> `FileFontStrike.getGlyphMetrics( )` was helpful as a guide regarding the expected behavior of `CStrike.getGlyphMetrics( )`.
>
> Tested on mac, Linux and Windows:
> - make test TEST="jtreg:test/jdk/java/awt/font"
> - make test TEST="jtreg:test/jdk/java/awt/Graphics2D/DrawString"
Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision:
Add defensive check for null ptr
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/29726/files
- new: https://git.openjdk.org/jdk/pull/29726/files/8356ec87..600d7c44
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=29726&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=29726&range=00-01
Stats: 11 lines in 1 file changed: 3 ins; 1 del; 7 mod
Patch: https://git.openjdk.org/jdk/pull/29726.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/29726/head:pull/29726
PR: https://git.openjdk.org/jdk/pull/29726
More information about the client-libs-dev
mailing list