RFR: 8285308: Win: Japanese logical fonts are drawn with wrong size

Naoto Sato naoto at openjdk.java.net
Fri Apr 22 17:49:27 UTC 2022


On Thu, 21 Apr 2022 09:14:14 GMT, Toshio Nakamura <tnakamura at openjdk.org> wrote:

> Japanese logical fonts are drawn with wrong size since Java 18.
> It's triggered by JEP 400, UTF-8 by Default. `sun.awt.FontConfiguration` (and `sun.awt.windows.WFontConfiguration`) seems to expect the native encoding instead of the default encoding. This patch changes to use native encoding.
> 
> Tested: jdk_desktop on Windows, Linux, and macOS

With JEP 400, the default charset may differ from the platform encoding, which is the case like this on Windows (mac & Linux won't be affected as they already use UTF-8 natively) and the mitigation here looks fine to me. But the real issue here to me is why the font size gets bigger depending on the encoding (windows-31j vs. UTF-8)?

-------------

PR: https://git.openjdk.java.net/jdk/pull/8329



More information about the client-libs-dev mailing list