diff options
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsfontengine.cpp | 13 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowsfontengine.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp index 33ddcaffc5..6b5304120b 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.cpp +++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp @@ -1133,6 +1133,8 @@ QWindowsNativeImage *QWindowsFontEngine::drawGDIGlyph(HFONT font, glyph_t glyph, << "If you need them anyway, start your application with -platform windows:fontengine=freetype."; } #endif // wince + + // The padding here needs to be kept in sync with the values in alphaMapBoundingBox. QWindowsNativeImage *ni = new QWindowsNativeImage(iw + 2 * margin + 4, ih + 2 * margin + 4, QWindowsNativeImage::systemFormat()); @@ -1167,6 +1169,17 @@ QWindowsNativeImage *QWindowsFontEngine::drawGDIGlyph(HFONT font, glyph_t glyph, return ni; } +glyph_metrics_t QWindowsFontEngine::alphaMapBoundingBox(glyph_t glyph, QFixed pos, const QTransform &matrix, GlyphFormat format) +{ + int margin = 0; + if (format == QFontEngine::Format_A32 || format == QFontEngine::Format_ARGB) + margin = glyphMargin(QFontEngineGlyphCache::Raster_RGBMask); + glyph_metrics_t gm = boundingBox(glyph, matrix); + gm.width += margin * 2 + 4; + gm.height += margin * 2 + 4; + return gm; +} + QImage QWindowsFontEngine::alphaMapForGlyph(glyph_t glyph, const QTransform &xform) { HFONT font = hfont; diff --git a/src/plugins/platforms/windows/qwindowsfontengine.h b/src/plugins/platforms/windows/qwindowsfontengine.h index 9e92a8fbff..60ff61fcb9 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.h +++ b/src/plugins/platforms/windows/qwindowsfontengine.h @@ -121,6 +121,7 @@ public: virtual QImage alphaMapForGlyph(glyph_t t) { return alphaMapForGlyph(t, QTransform()); } virtual QImage alphaMapForGlyph(glyph_t, const QTransform &xform); virtual QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, const QTransform &xform); + virtual glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed, const QTransform &matrix, GlyphFormat); virtual QFontEngine *cloneWithSize(qreal pixelSize) const; virtual bool supportsTransformation(const QTransform &transform) const; |