FontMetrics differ between OracleJDK 8 and OpenJDK 11
philip.race at oracle.com
Mon Dec 24 21:23:48 UTC 2018
Again, wrong list. And anyway all openjdk lists are for people contributing. You can report bugs at Java.com
> On Dec 24, 2018, at 9:33 AM, Tredinnick, Jacob <jacob_tredinnick at mentor.com> wrote:
> 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.
More information about the discuss