JDK-8237782 : Only read advances up to the minimum of the numHorMetrics or the available font data.
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8,openjfx11,openjfx15
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-01-23
  • Updated: 2020-06-22
  • Resolved: 2020-01-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 Other
8u261Fixed openjfx11.0.8Fixed
The hmtx table stores the linearly scaled advances of all glyphs.

Per the opentype spec there can be fewer records in the table than there are glyphs in which case all entries past the last one apply to all remaining glyphs. The advance lookup code handles that.

But what if there are records entries in the table than specified by the numHorMetrics field in the hhea table ?

When we populate the advance widths we should stop reading when we reach the end of the table, else we could get a Java exception which would stop the font from being loaded when it might otherwise be OK - at least up to the extent of the valid data.

Changeset: 95bf2c00 Author: Phil Race <prr@openjdk.org> Date: 2020-01-31 18:22:52 +0000 URL: https://git.openjdk.java.net/jfx/commit/95bf2c00