RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object

Daniel Gredler dgredler at openjdk.org
Fri Mar 7 21:47:51 UTC 2025


On Mon, 17 Feb 2025 14:06:53 GMT, Daniel Gredler <dgredler at openjdk.org> wrote:

> On other platforms like Windows and Linux, the `\n`, `\r` and `\t` characters are ignored when drawing text to a `Graphics2D` object. On macOS this is not currently the case.
> 
> See, for example, `CMap.getControlCodeGlyph(int, boolean)` or `RasterPrinterJob.removeControlChars(String)`.
> 
> This bug was found while running `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java` on macOS.
> 
> The new test class passes on Linux, Windows and macOS.

I'm checking with the HarfBuzz guys to see if there's a possible fix on their end: https://github.com/harfbuzz/harfbuzz/discussions/5118

Unfortunately, it sounds like glyph ID `0xFFFF` means "delete me" by convention in the AAT world, so it's a little complicated.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/23665#issuecomment-2707518125


More information about the client-libs-dev mailing list