summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsfontengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsfontengine.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsfontengine.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp
index 33ddcaffc5..64457f4b67 100644
--- a/src/plugins/platforms/windows/qwindowsfontengine.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp
@@ -1133,8 +1133,10 @@ QWindowsNativeImage *QWindowsFontEngine::drawGDIGlyph(HFONT font, glyph_t glyph,
<< "If you need them anyway, start your application with -platform windows:fontengine=freetype.";
}
#endif // wince
- QWindowsNativeImage *ni = new QWindowsNativeImage(iw + 2 * margin + 4,
- ih + 2 * margin + 4,
+
+ // The padding here needs to be kept in sync with the values in alphaMapBoundingBox.
+ QWindowsNativeImage *ni = new QWindowsNativeImage(iw + 2 * margin,
+ ih + 2 * margin,
QWindowsNativeImage::systemFormat());
/*If cleartype is enabled we use the standard system format even on Windows CE
@@ -1167,6 +1169,17 @@ QWindowsNativeImage *QWindowsFontEngine::drawGDIGlyph(HFONT font, glyph_t glyph,
return ni;
}
+glyph_metrics_t QWindowsFontEngine::alphaMapBoundingBox(glyph_t glyph, QFixed, 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;
+ gm.height += margin * 2;
+ return gm;
+}
+
QImage QWindowsFontEngine::alphaMapForGlyph(glyph_t glyph, const QTransform &xform)
{
HFONT font = hfont;