From 8261a134b1e183e3d13587e56ab68fa057eb6a06 Mon Sep 17 00:00:00 2001 From: Daniel Gredler Date: Thu, 25 Sep 2025 20:49:57 +0200 Subject: [PATCH 1/3] Avoid loss of font transform and attributes --- .../macosx/classes/sun/lwawt/macosx/CTextPipe.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTextPipe.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTextPipe.java index 6fdda409ce5fe..5e4c2c090adef 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTextPipe.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTextPipe.java @@ -97,8 +97,14 @@ private Font getSlotFont(Font font, int slot) { if (f2d instanceof CFont) { CompositeFont cf = ((CFont)f2d).getCompositeFont2D(); PhysicalFont pf = cf.getSlotFont(slot); - Font f = new Font(pf.getFontName(null), - font.getStyle(), font.getSize()); + String name = pf.getFontName(null); + Font f = new Font(name, font.getStyle(), font.getSize()); + if (font.isTransformed()) { + f = f.deriveFont(font.getTransform()); + } + if (font.hasLayoutAttributes()) { + f = f.deriveFont(font.getAttributes()); + } return f; } return null; From d3155ecaa18894520acad57de46da0194cbf17d3 Mon Sep 17 00:00:00 2001 From: Daniel Gredler Date: Fri, 26 Sep 2025 01:27:15 +0200 Subject: [PATCH 2/3] Update copyright year --- src/java.desktop/macosx/classes/sun/lwawt/macosx/CTextPipe.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTextPipe.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTextPipe.java index 5e4c2c090adef..cf4a6e72136c4 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTextPipe.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTextPipe.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it From fcf741523bd2fcc4da06015f22bcbc6fda0028c9 Mon Sep 17 00:00:00 2001 From: Daniel Gredler Date: Mon, 29 Sep 2025 13:43:12 +0200 Subject: [PATCH 3/3] Add bug ID to test bug annotation --- test/jdk/java/awt/print/PrinterJob/PrintTextTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/java/awt/print/PrinterJob/PrintTextTest.java b/test/jdk/java/awt/print/PrinterJob/PrintTextTest.java index 06e71c4067f21..defca807fc00a 100644 --- a/test/jdk/java/awt/print/PrinterJob/PrintTextTest.java +++ b/test/jdk/java/awt/print/PrinterJob/PrintTextTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 6425068 7156751 7157659 8029204 8132890 8148334 8344637 + * @bug 6425068 7156751 7157659 8029204 8132890 8148334 8344637 8368702 * @key printer * @summary Confirm that text prints where we expect to the length we expect. * @library /java/awt/regtesthelpers