RFR: 8219641: java/awt/font/Rotate/RotatedTextTest.java fails on Linux: Test failed for angle 15.0

Phil Race prr at openjdk.org
Mon Sep 18 23:36:40 UTC 2023


On Mon, 18 Sep 2023 06:19:05 GMT, Arno Zeller <azeller at openjdk.org> wrote:

> The test fails on newer SLES versions that have RobotoSlab-Regular.ttf as default font. I suggest to try getting a DejaVu font as default on Linux because it is known to work without issues.

The bug report has "Angle: 15, width diff: -4"
Over the length of the string "The quick brown fox jumps over the lazy dog"  that could be the occasional rounding difference
and there is a comment in the bug report claiming (suggesting?) that's the issue.
It is a bit tricky to know what error to allow because if you have a case where all the glyphs are rounded differently it could be 1 pixel per glyph .. much more than "4".
Even Deja Vu Sans might reproduce this given the right (or wrong) string.

The JDK rounding code has been stable for a while now and changing that could cause problems elsewhere.
And I'm not sure we can 100% guarantee no difference in all cases, because the rasteriser has a say in this too, and
likely that's where the difference is coming from here and the rounding then exacerbates the difference.

Drawing and measuring the string using fractional metrics and floating point with a tolerance might have been a
better bet here but that's more surgery on the test.

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

PR Comment: https://git.openjdk.org/jdk/pull/15780#issuecomment-1724619821


More information about the client-libs-dev mailing list