On Fri, 13 Mar 2026 15:36:40 GMT, Daniel Gredler <[email protected]> wrote:
> `PrintTextTest` is currently failing for macOS. The biggest remaining issue > is that the printed Page 8 does not match the on-screen Page 8, because a > font with an `AffineTransform` with translation and rotation is used, and the > translation component is not treated correctly during printing. > > This issue is an offshoot of > [JDK-8148334](https://bugs.openjdk.org/browse/JDK-8148334), which tracks > success of this test case across all platforms. > > There are two main aspects to this bug. First, if the font contains a > transform with a translation component, `SunGraphics2D.checkFontInfo(...)` > extracts the translation component into the `FontInfo` and then clears the > translation component from the transform. However, the way it was being > cleared does not work when there is a rotation component. Second, the three > drawing methods in `CTextPipe` were ignoring this translation component. Both > aspects are fixed here. > > I've also fixed a small typo in the JavaDoc for > `AffineTransform.getMatrix(...)` which confused me during the debugging of > this issue. > > I've tested locally on Windows, Linux and mac, but `SunGraphics2D` is shared > across all platforms, and that part of the change could have some subtle > interactions with other parts of the code that my tests haven't caught, so we > may want a full CI test run prior to approval. > > After this fix, it looks like there is only one smaller issue with > `PrintTextTest` remaining on macOS: on pages 3 and 4, the physical font > selected by the test (at least on my machine -- it's just looping through > available fonts and selecting the first one available, so the selected > physical font may be different on other machines) draws with different char > advances vs the expected char advances, so the lines printed under the text > are longer than the text. This seems to be font-specific, as some physical > fonts look fine and others don't, but will require more research. This pull request has now been integrated. Changeset: cddee6d6 Author: Daniel Gredler <[email protected]> URL: https://git.openjdk.org/jdk/commit/cddee6d6eb3e048635c380a32bd2f6ebfd2c18b5 Stats: 34 lines in 4 files changed: 22 ins; 1 del; 11 mod 8380028: Fix Page8 of manual test java/awt/print/PrinterJob/PrintTextTest.java on macOS Reviewed-by: prr, psadhukhan ------------- PR: https://git.openjdk.org/jdk/pull/30244
