diff options
author | Gunnar Sletta <gunnar@trolltech.com> | 2009-04-20 09:39:52 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar@trolltech.com> | 2009-04-20 09:48:25 (GMT) |
commit | 0b15f59c648633357e9263e93c688e5462e3e01e (patch) | |
tree | 880af877e0d6ffb51ef9f8a194b11fc07e7a5635 /src/gui/text | |
parent | 33259249106e16052b60c55a35539c9f8cb0414d (diff) | |
download | Qt-0b15f59c648633357e9263e93c688e5462e3e01e.zip Qt-0b15f59c648633357e9263e93c688e5462e3e01e.tar.gz Qt-0b15f59c648633357e9263e93c688e5462e3e01e.tar.bz2 |
Properly support the "prefer antialias" font style
Since the introduction of the texture glyph cache we rendered these
fonts as 8-bit gray masks which looked bad and cut off a few pixels
for thin glyphs. Changed the preferred format of the font engine
to be Raster_RGBMask.
Task-number: 248141
Reviewed-by: Eskil B
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qfontdatabase_win.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gui/text/qfontdatabase_win.cpp b/src/gui/text/qfontdatabase_win.cpp index c9f5586..780ae28 100644 --- a/src/gui/text/qfontdatabase_win.cpp +++ b/src/gui/text/qfontdatabase_win.cpp @@ -699,6 +699,7 @@ QFontEngine *loadEngine(int script, const QFontPrivate *fp, const QFontDef &requ } bool stockFont = false; + bool preferClearTypeAA = false; HFONT hfont = 0; @@ -799,10 +800,12 @@ QFontEngine *loadEngine(int script, const QFontPrivate *fp, const QFontDef &requ #endif if (request.styleStrategy & QFont::PreferAntialias) { - if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP) + if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP) { qual = 5; // == CLEARTYPE_QUALITY; - else + preferClearTypeAA = true; + } else { qual = ANTIALIASED_QUALITY; + } } else if (request.styleStrategy & QFont::NoAntialias) { qual = NONANTIALIASED_QUALITY; } @@ -884,6 +887,9 @@ QFontEngine *loadEngine(int script, const QFontPrivate *fp, const QFontDef &requ } QFontEngineWin *few = new QFontEngineWin(font_name, hfont, stockFont, lf); + if (preferClearTypeAA) + few->glyphFormat = QFontEngineGlyphCache::Raster_RGBMask; + // Also check for OpenType tables when using complex scripts // ### TODO: This only works for scripts that require OpenType. More generally // for scripts that do not require OpenType we should just look at the list of @@ -1134,7 +1140,7 @@ static void getFamiliesAndSignatures(const QByteArray &fontData, QFontDatabasePr signature.fsUsb[1] = qFromBigEndian<quint32>(table + 46); signature.fsUsb[2] = qFromBigEndian<quint32>(table + 50); signature.fsUsb[3] = qFromBigEndian<quint32>(table + 54); - + signature.fsCsb[0] = qFromBigEndian<quint32>(table + 78); signature.fsCsb[1] = qFromBigEndian<quint32>(table + 82); } |