[OpenJDK 2D-Dev] RFR: 8233097: Fontmetrics for large Fonts has zero width

Phil Race philip.race at oracle.com
Wed Oct 30 18:05:59 UTC 2019

Bug: https://bugs.openjdk.java.net/browse/JDK-8233097
Webrev: http://cr.openjdk.java.net/~prr/8233097/

This bug is a regression from a fix in JDK 13.0.1 / 11.0.5

To work around a bug in old versions of freetype we capped the size
of the glyph image but overlooked that we may use that code to get
metrics even when the glyph image isn't needed.

The fix is to still get the metrics the same way but in such a case
skip getting the image.

When the new "renderImage" variable is true the changes in the
code should be a no-op, and this is used for metrics and images
for typical sizes. So theoretically at least, safe there.

For renderImage == false, as used from the advance/metrics functions
it guards against rendering the image or accessing bitmap fields.

The advance/metrics cases discard the image so it should also be safe there.

I'm running regression tests as well as Font2DTest and all passes so far.

This will need to be backported to 11u, so does still need careful review.


More information about the 2d-dev mailing list