[jdk25u] RFR: 8361381: GlyphLayout behavior differs on JDK 11+ compared to JDK 8

Vishal Chand duke at openjdk.org
Fri Nov 14 15:12:08 UTC 2025


Backporting:

8361381: GlyphLayout behavior differs on JDK 11+ compared to JDK 8

Summary of the change:
* Fixes a regression in HarfBuzz-based text layout in JDK 9+ where GlyphLayout incorrectly clustered characters in complex scripts (e.g., Khmer) due to faulty “each glyph maps to one character” assumptions.
* Adjusts the clustering algorithm in `ExtendedTextSourceLabel::createCharinfo()` by removing the needless `clusterExtraGlyphs` logic so line-breaking and wrapping behave consistently with JDK 8.

Testing:
* tests in `test/jdk/java/awt/font/` are passing locally on Amazon Linux 2.

Applies cleanly, low risk.

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

Commit messages:
 - Backport bcff857ba09028cc43e856726b5c839cc6b1b0d9

Changes: https://git.openjdk.org/jdk25u/pull/379/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk25u&pr=379&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8361381
  Stats: 141 lines in 3 files changed: 133 ins; 5 del; 3 mod
  Patch: https://git.openjdk.org/jdk25u/pull/379.diff
  Fetch: git fetch https://git.openjdk.org/jdk25u.git pull/379/head:pull/379

PR: https://git.openjdk.org/jdk25u/pull/379


More information about the jdk-updates-dev mailing list