summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorTrond Kjernaasen <trond@trolltech.com>2009-05-14 15:38:56 (GMT)
committerTrond Kjernaasen <trond@trolltech.com>2009-05-14 15:45:13 (GMT)
commit85f98acaa3a38079071bea711e43c9a86edec1f6 (patch)
treef80ad70a065e8086b9095f559fe2edfab859798e /src/gui/text
parentd644a9a89ff4f7bf8866b69af5334ea1c696e4a7 (diff)
downloadQt-85f98acaa3a38079071bea711e43c9a86edec1f6.zip
Qt-85f98acaa3a38079071bea711e43c9a86edec1f6.tar.gz
Qt-85f98acaa3a38079071bea711e43c9a86edec1f6.tar.bz2
Fixed an issue with text drawing under Windows.
Some text drawn with OpenType fonts where cut off by a pixel or two under certain circumstances. This adds an additional 2 pixel pad margin to the glyph cache entries. The padding behaves slightly different when ClearType is enabled/disabled, hence the general 2 pixel padding. Task-number: 246196 Reviewed-by: Samuel
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfontengine_win.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp
index 1996d44..bf3a176 100644
--- a/src/gui/text/qfontengine_win.cpp
+++ b/src/gui/text/qfontengine_win.cpp
@@ -1406,8 +1406,8 @@ QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin
#endif
#endif
- QNativeImage *ni = new QNativeImage(iw + 2 * margin,
- ih + 2 * margin,
+ QNativeImage *ni = new QNativeImage(iw + 2 * margin + 2,
+ ih + 2 * margin + 2,
QNativeImage::systemFormat(), true);
ni->image.fill(0xffffffff);
@@ -1449,7 +1449,7 @@ QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform)
font = CreateFontIndirectW(&lf);
}
- QNativeImage *mask = drawGDIGlyph(font, glyph, 0, xform);
+ QNativeImage *mask = drawGDIGlyph(font, glyph, 2, xform);
if (mask == 0)
return QImage();