On Wed, 17 Sep 2025 13:28:57 GMT, Daniel Gredler <[email protected]> wrote:
> When text is printed (or drawn to screen), some whitespace characters like
> new lines should be ignored (see `FontUtilities.isIgnorableWhitespace(int)`).
> This is currently not being done when printing on macOS, and is one (of about
> half a dozen) reasons why `java/awt/print/PrinterJob/PrintTextTest.java` is
> currently problem listed on macOS. Fixing this bug will get us one step
> closer to removing this test from the problem list.
>
> Within `PrintTextTest`, this issue can be seen specifically with the extra
> space before and after "drawChars(" on every page of the printed document.
> This whitespace should not be present.
>
> This change aligns behavior with printing on other platforms (see
> `RasterPrinterJob.removeControlChars(String)`) and with screen display on
> macOS (see `CCharToGlyphMapper`) and other platforms.
This pull request has now been integrated.
Changeset: 2407eb05
Author: Daniel Gredler <[email protected]>
URL:
https://git.openjdk.org/jdk/commit/2407eb0522d192135a6bed52e88be5a59cba8f6c
Stats: 34 lines in 4 files changed: 16 ins; 8 del; 10 mod
8367867: [macosx] Ignorable whitespace in text not removed when printing
Reviewed-by: prr, serb
-------------
PR: https://git.openjdk.org/jdk/pull/27345