RFR: 8357672: Extreme font sizes can cause font substitution

Phil Race prr at openjdk.org
Wed May 28 20:24:03 UTC 2025


Instrumenting the existing ExtremeFontSizeTest.java, it was noted that the freetype code, when encountering a null return from getting a scaler context, would over-interpret this as a bad font.
The test was intended to check this wasn't happening by verifying metrics before and after using extreme sizes.
But the scenaro was not being detected by the test because a replacement font was substituted and it did not have zero metrics.
So the updated test checks that the metrics before and after are the same.
This new version of the test failed on Linux before the JDK source updates and passes afterwards.

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

Commit messages:
 - 8357672
 - 8357672

Changes: https://git.openjdk.org/jdk/pull/25511/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25511&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8357672
  Stats: 104 lines in 3 files changed: 92 ins; 2 del; 10 mod
  Patch: https://git.openjdk.org/jdk/pull/25511.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25511/head:pull/25511

PR: https://git.openjdk.org/jdk/pull/25511


More information about the client-libs-dev mailing list