diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-05-16 18:16:04 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-05-16 18:16:04 +0300 |
commit | 231d3670981a33ec42b91ad1cb33c1fc50551066 (patch) | |
tree | b1ef1096f4e279baaa2ea0d2daf14b5c4185a82f /src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp | |
parent | ffdd372c7bbda62e9d937f406319f38e3e982774 (diff) | |
parent | 8fc1a885d19a2dfb1a3a684aea1cfa41967e041f (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.5' into tqtc/lts-5.15-opensourcev5.15.5-lts-lgpl
Change-Id: I0cdb390124e783dc9cd832a9954baa76a0e9eb6b
Diffstat (limited to 'src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp')
-rw-r--r-- | src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp index c09d782333..aa9d6fd47c 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp @@ -1038,7 +1038,9 @@ static bool addFontToDatabase(QString familyName, const QString foundryName; // No such concept. const bool fixed = !(textmetric->tmPitchAndFamily & TMPF_FIXED_PITCH); const bool ttf = (textmetric->tmPitchAndFamily & TMPF_TRUETYPE); - const bool scalable = textmetric->tmPitchAndFamily & (TMPF_VECTOR|TMPF_TRUETYPE); + const bool unreliableTextMetrics = type == 0; + const bool scalable = (textmetric->tmPitchAndFamily & (TMPF_VECTOR|TMPF_TRUETYPE)) + && !unreliableTextMetrics; const int size = scalable ? SMOOTH_SCALABLE : textmetric->tmHeight; const QFont::Style style = textmetric->tmItalic ? QFont::StyleItalic : QFont::StyleNormal; const bool antialias = false; @@ -1118,13 +1120,13 @@ static bool addFontToDatabase(QString familyName, style, stretch, antialias, scalable, size, fixed, writingSystems, createFontFile(faceName)); // add fonts windows can generate for us: - if (weight <= QFont::DemiBold && styleName.isEmpty()) + if (weight <= QFont::DemiBold) QPlatformFontDatabase::registerFont(familyName, QString(), foundryName, QFont::Bold, style, stretch, antialias, scalable, size, fixed, writingSystems, createFontFile(faceName)); - if (style != QFont::StyleItalic && styleName.isEmpty()) + if (style != QFont::StyleItalic) QPlatformFontDatabase::registerFont(familyName, QString(), foundryName, weight, QFont::StyleItalic, stretch, antialias, scalable, size, fixed, writingSystems, createFontFile(faceName)); - if (weight <= QFont::DemiBold && style != QFont::StyleItalic && styleName.isEmpty()) + if (weight <= QFont::DemiBold && style != QFont::StyleItalic) QPlatformFontDatabase::registerFont(familyName, QString(), foundryName, QFont::Bold, QFont::StyleItalic, stretch, antialias, scalable, size, fixed, writingSystems, createFontFile(faceName)); |