diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2017-07-28 08:58:42 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2017-07-31 09:48:38 +0000 |
commit | 1eedfd0e66c7afd682f682a659cda2942485cd08 (patch) | |
tree | 3a1f9332cd48e9ed80555084b33444c719a0c285 /src/platformsupport | |
parent | 3d195c41e53847f7ec74a93f79e7a64d3581f8a8 (diff) |
Windows: Stop considering Calibri as bitmap font
This reverts 2bc619c30ef08c9b5e2aaa3370d184670acd73ad, which tried to
fix an unspecified problem by regarding all fonts with EBDT tables as
potential bitmap fonts. The change log does not have any reference to
a bug report or a problematic font. It also singled out Windows and GDI
as the only font engine where this was necessary, which caused difference
in behavior between different platforms, and even a difference in
behavior on Windows when setting the hinting preference or turning on
high-DPI scaling.
The fact is that any font may have an EBDT table, and Microsoft has this
for the smaller pixel sizes of many of their default fonts, e.g. Calibri.
The result was that Qt would detect these as bitmap fonts and refuse to
use distance field rendering for them.
If there are fonts where it is a real problem that some glyphs only exist
as bitmaps, we first need to know about them. Then we need to find some
other solution than a blanket blacklist of all fonts with EBDT tables.
For instance, we could separate the bitmap glyphs into their own QGlyphRuns
and use native rendering only for those specific glyphs.
[ChangeLog][Windows][Fonts] Some key fonts, such as Calibri, were being
detected as bitmap fonts and not rendered correctly in Qt Quick. This has
now been fixed.
Task-number: QTBUG-62176
Change-Id: If892390cc74f180c5df9ef80484ba2eb0319f987
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/platformsupport')
-rw-r--r-- | src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp | 16 | ||||
-rw-r--r-- | src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h | 2 |
2 files changed, 1 insertions, 17 deletions
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp index 6e95fb5a05..4be2182188 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp @@ -130,20 +130,6 @@ bool QWindowsFontEngine::hasCMapTable() const return GetFontData(hdc, MAKE_LITTLE_ENDIAN_TAG('c', 'm', 'a', 'p'), 0, 0, 0) != GDI_ERROR; } -bool QWindowsFontEngine::hasGlyfTable() const -{ - HDC hdc = m_fontEngineData->hdc; - SelectObject(hdc, hfont); - return GetFontData(hdc, MAKE_LITTLE_ENDIAN_TAG('g', 'l', 'y', 'f'), 0, 0, 0) != GDI_ERROR; -} - -bool QWindowsFontEngine::hasEbdtTable() const -{ - HDC hdc = m_fontEngineData->hdc; - SelectObject(hdc, hfont); - return GetFontData(hdc, MAKE_LITTLE_ENDIAN_TAG('E', 'B', 'D', 'T'), 0, 0, 0) != GDI_ERROR; -} - static inline QString stringFromOutLineTextMetric(const OUTLINETEXTMETRIC *otm, PSTR offset) { const uchar *p = reinterpret_cast<const uchar *>(otm) + quintptr(offset); @@ -274,7 +260,7 @@ QWindowsFontEngine::QWindowsFontEngine(const QString &name, userData.insert(QStringLiteral("trueType"), QVariant(bool(ttf))); setUserData(userData); - hasUnreliableOutline = hasGlyfTable() && hasEbdtTable(); + hasUnreliableOutline = (tm.tmPitchAndFamily & (TMPF_TRUETYPE | TMPF_VECTOR)) == 0; } QWindowsFontEngine::~QWindowsFontEngine() diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h index 5119adc0eb..76b45d7a7b 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h @@ -138,8 +138,6 @@ private: QImage::Format mask_format); bool hasCFFTable() const; bool hasCMapTable() const; - bool hasGlyfTable() const; - bool hasEbdtTable() const; const QSharedPointer<QWindowsFontEngineData> m_fontEngineData; |