From 736cc1d564a204f66b2a3dd8e12a34b64a38d971 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 8 Feb 2019 12:43:26 +0100 Subject: Don't wrongly detect fonts as oblique We were interpreting bit #8 as the oblique bit, but this is the WWS-conformity bit. Bit #10 is the oblique bit. [ChangeLog][Windows] Fixed an issue where loading fonts from files or data would sometimes mistakenly classify them as oblique. Fixes: QTBUG-73660 Change-Id: Id9e5012d1b89d0bee0e966c5105657b38834e13a Reviewed-by: Lars Knoll Reviewed-by: Konstantin Ritt --- src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/platformsupport') diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp index 40ac46df85..bd4338feb8 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp @@ -1429,8 +1429,8 @@ QT_WARNING_POP reinterpret_cast(fontData.constData() + qFromBigEndian(os2TableEntry->offset)); - bool italic = qFromBigEndian(os2Table->selection) & 1; - bool oblique = qFromBigEndian(os2Table->selection) & 128; + bool italic = qFromBigEndian(os2Table->selection) & (1 << 0); + bool oblique = qFromBigEndian(os2Table->selection) & (1 << 9); if (italic) fontEngine->fontDef.style = QFont::StyleItalic; -- cgit v1.2.3