Skip to content

Commit

Permalink
Don't wrongly detect fonts as oblique
Browse files Browse the repository at this point in the history
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 <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
  • Loading branch information
eskilblomfeldt committed Feb 13, 2019
1 parent 9f3cdf3 commit 736cc1d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1429,8 +1429,8 @@ QT_WARNING_POP
reinterpret_cast<const OS2Table *>(fontData.constData()
+ qFromBigEndian<quint32>(os2TableEntry->offset));

bool italic = qFromBigEndian<quint16>(os2Table->selection) & 1;
bool oblique = qFromBigEndian<quint16>(os2Table->selection) & 128;
bool italic = qFromBigEndian<quint16>(os2Table->selection) & (1 << 0);
bool oblique = qFromBigEndian<quint16>(os2Table->selection) & (1 << 9);

if (italic)
fontEngine->fontDef.style = QFont::StyleItalic;
Expand Down

0 comments on commit 736cc1d

Please sign in to comment.