diff options
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsfontengine.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsfontengine.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp index 4f3a007bd7..6f97c8584b 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.cpp +++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp @@ -169,6 +169,20 @@ bool QWindowsFontEngine::hasCMapTable() const return GetFontData(hdc, MAKE_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_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_TAG('E', 'B', 'D', 'T'), 0, 0, 0) != GDI_ERROR; +} + void QWindowsFontEngine::getCMap() { ttf = (bool)(tm.tmPitchAndFamily & TMPF_TRUETYPE) || hasCMapTable(); @@ -308,6 +322,8 @@ QWindowsFontEngine::QWindowsFontEngine(const QString &name, userData.insert(QStringLiteral("hFont"), QVariant::fromValue(hfont)); userData.insert(QStringLiteral("trueType"), QVariant(bool(ttf))); setUserData(userData); + + hasUnreliableOutline = hasGlyfTable() && hasEbdtTable(); } QWindowsFontEngine::~QWindowsFontEngine() @@ -662,6 +678,11 @@ void QWindowsFontEngine::getGlyphBearings(glyph_t glyph, qreal *leftBearing, qre } #endif // Q_CC_MINGW +bool QWindowsFontEngine::hasUnreliableGlyphOutline() const +{ + return hasUnreliableOutline; +} + qreal QWindowsFontEngine::minLeftBearing() const { if (lbearing == SHRT_MIN) @@ -1032,7 +1053,7 @@ QWindowsNativeImage *QWindowsFontEngine::drawGDIGlyph(HFONT font, glyph_t glyph, int iw = gm.width.toInt(); int ih = gm.height.toInt(); - if (iw <= 0 || iw <= 0) + if (iw <= 0 || ih <= 0) return 0; bool has_transformation = t.type() > QTransform::TxTranslate; |