summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@nokia.com>2009-06-05 13:40:17 (GMT)
committerThomas Hartmann <Thomas.Hartmann@nokia.com>2009-06-05 13:46:27 (GMT)
commit407a77cb2660cf122b08a388216f3a2da8cfd1c3 (patch)
treeb5c609d9fe6ab2974d423212c6153198844e2ef8 /src
parent65f6422401f7dfeb5f3a7fcc3791528b4cf2cee4 (diff)
downloadQt-407a77cb2660cf122b08a388216f3a2da8cfd1c3.zip
Qt-407a77cb2660cf122b08a388216f3a2da8cfd1c3.tar.gz
Qt-407a77cb2660cf122b08a388216f3a2da8cfd1c3.tar.bz2
Fixes anti-aliased text rendering on smartphones (Windows Mobile)
The check for cleartype in qt_win_read_cleartype_settings() was not correct for Windows Mobile For anti-aliased text rendering we also have to use another pixel format for the native image. Task-number: 249642 Reviewed-by: mauricek
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qapplication_win.cpp8
-rw-r--r--src/gui/text/qfontengine_win.cpp8
2 files changed, 14 insertions, 2 deletions
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 60f3edf..b21eb36 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -625,6 +625,13 @@ static void qt_set_windows_font_resources()
static void qt_win_read_cleartype_settings()
{
+#ifdef Q_OS_WINCE
+ UINT result;
+ BOOL ok;
+ ok = SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &result, 0);
+ if (ok)
+ qt_cleartype_enabled = result;
+#else
QT_WA({
UINT result;
BOOL ok;
@@ -638,6 +645,7 @@ static void qt_win_read_cleartype_settings()
if (ok)
qt_cleartype_enabled = (result == FE_FONTSMOOTHINGCLEARTYPE);
});
+#endif
}
diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp
index 002e670..d172a81 100644
--- a/src/gui/text/qfontengine_win.cpp
+++ b/src/gui/text/qfontengine_win.cpp
@@ -1333,6 +1333,7 @@ bool QFontEngineWin::getSfntTableData(uint tag, uchar *buffer, uint *length) con
# define CLEARTYPE_QUALITY 5
#endif
+extern bool qt_cleartype_enabled;
QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin,
const QTransform &t)
@@ -1408,7 +1409,11 @@ QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin
QNativeImage *ni = new QNativeImage(iw + 2 * margin + 4,
ih + 2 * margin + 4,
- QNativeImage::systemFormat(), true);
+ QNativeImage::systemFormat(), !qt_cleartype_enabled);
+
+ /*If cleartype is enabled we use the standard system format even on Windows CE
+ and not the special textbuffer format we have to use if cleartype is disabled*/
+
ni->image.fill(0xffffffff);
HDC hdc = ni->hdc;
@@ -1437,7 +1442,6 @@ QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin
}
-extern bool qt_cleartype_enabled;
extern uint qt_pow_gamma[256];
QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform)