From 684024b51e81b0999d22e91169c0f99faec6bda9 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Fri, 2 Aug 2019 15:30:23 +0300 Subject: [PATCH] JBR-1714 Italic text is displayed using incorrect glyphs on Windows port from JBR 11 to JBR 15 (cherry picked from commits 46e4cdfcbd67fa35265acfffe0b3f820bfdfdf18, 9cc5cbc99bf23704ee92a26321712d2edd3e53a1) cherry picked from commit 6769b27e53eac17789a6f86afbaa360e49829280 (cherry picked from commit eccee7282397abd555d8fe6c19253c13c3ae4296) --- src/java.desktop/share/classes/sun/font/FileFontStrike.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/java.desktop/share/classes/sun/font/FileFontStrike.java b/src/java.desktop/share/classes/sun/font/FileFontStrike.java index ba86b80eb473..6f9e12350292 100644 --- a/src/java.desktop/share/classes/sun/font/FileFontStrike.java +++ b/src/java.desktop/share/classes/sun/font/FileFontStrike.java @@ -388,8 +388,12 @@ public class FileFontStrike extends PhysicalStrike { long getGlyphImageFromWindows(int glyphCode) { String family = fileFont.getFamilyName(null); + FontFamily fontFamily = FontFamily.getFamily(family); int style = desc.style & Font.BOLD | desc.style & Font.ITALIC | fileFont.getStyle(); + if (fontFamily != null && fontFamily.getFont(style) != fileFont) { + style = fileFont.getStyle(); + } int size = intPtSize; byte charset = fileFont.getSupportedCharset(); long ptr = 0;