[OpenJDK 2D-Dev] [11u] java/awt/FontMetrics/MaxAdvanceIsMax.java test failure (was: [11u] RFR 8210782: Upgrade HarfBuzz to the latest 2.3.1)

Martin Balao mbalao at redhat.com
Tue May 14 16:41:00 UTC 2019

Hi Goetz,

On 5/13/19 1:38 PM, Lindenmaier, Goetz wrote:
> Can I somehow verify that it's the font that has the problem?
> Can I fix the font so that the test passes?

I cannot say whether or not the static max advance value in each font is
right or not, but let's assume it is. The underlying problem here is
that OpenJDK uses a couple of internal FreeType library values to
calculate the effects of algorithmic bold and italic in the max advance
value -"algorithmic" means that the font is not italic or bold and is up
to the rendering engine to generate the desired effect-. These values
have changed over the years. What we did in 8218854 [1] was updating the
italic value to the latest version and supporting bold in the
calculation. Ideally, OpenJDK should not be tight to these values.
However, that's not easy to get rid of unless we change the API or the
API semantics. All this means that if you use OpenJDK 11 with an old
Free Type library, you may have different values and the test may fail.

Note: this is just an hypothesis, I couldn't reproduce on my own.

I believe the test assertion is right if we consider API semantics only
but we can put some constraints given reality.

Kind regards,

[1] - http://hg.openjdk.java.net/jdk/jdk/rev/0804f29e8be7

More information about the 2d-dev mailing list