[OpenJDK 2D-Dev] FontMetrics differ between OracleJDK 8 and OpenJDK 11

Tredinnick, Jacob jacob_tredinnick at mentor.com
Sat Dec 29 15:50:59 UTC 2018


My team is currently working on migrating some of our (mostly Desktop & Swing-based) applications from OracleJDK 8 to OpenJDK 11 and we have discovered that some fonts in our application are getting drawn significantly differently e.g. significantly larger, differences with spaces between characters.

When debugging, we found that the FontMetrics for the Font obtained as follows:
FontMetrics metrics = Toolkit.getDefaultToolkit().getFontMetrics(font);

Returns significantly different values:
For example a plain, size 12 Calibri font:
In OracleJDK 8 metrics.getMaxAscent() returns 11, while in OracleJDK 11 it returns 9.

I understand that the proprietary "T2K" font engine was replaced by "FreeType" in OpenJDK but I'm surprised at the very noticeable differences that we now see in some of our text objects.
Is it expected that FontMetrics would be so significantly different between OracleJDK 8 and OpenJDK 11?

Note: I can share the code that generates the font metrics as well as a file describing all the diffs for fonts on my laptop if needed.

Note also:
We did attempt to submit a bug for this behaviour via https://bugreport.java.com/bugreport/
But when we search for our bug ID 9058505 there are no results, presumably meaning that no-one has accepted this as a bug so far.
I'm not sure if anyone here is able to find out what happened to our report?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20181229/62013312/attachment.html>

More information about the 2d-dev mailing list