summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2012-06-11 12:46:17 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-14 10:11:23 +0200
commit6da6845f078e419ccb555fe1dd152e0ba82a7e88 (patch)
tree30308dc105380ca5840aad202bb487ef1c238f58 /src
parentcb97d846e2c50718ca5795dac4c3111e4136e479 (diff)
Disable hinting for scaled glyphs in FreeType
Scaling hinted glyphs looks ugly, and it makes smooth scaling animation not possible. Since nothing will work as intended in hinted mode, we should disable hinting automatically when glyphs are loaded with scaling transformation. Task-number: QTBUG-24846 Change-Id: Id7fb5f5bdc2d00be157b0c5d55c316473571473c Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qfontengine_ft.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index f83ddd3d53..46fd29313d 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -1774,7 +1774,10 @@ QImage *QFontEngineFT::lockedAlphaMapForGlyph(glyph_t glyphIndex, QFixed subPixe
QFontEngineFT::Glyph *glyph;
if (cacheEnabled) {
QFontEngineFT::QGlyphSet *gset = &defaultGlyphSet;
+ QFontEngine::HintStyle hintStyle = default_hint_style;
if (t.type() >= QTransform::TxScale) {
+ // disable hinting if the glyphs are transformed
+ default_hint_style = HintNone;
if (t.isAffine())
gset = loadTransformedGlyphSet(t);
else
@@ -1790,9 +1793,11 @@ QImage *QFontEngineFT::lockedAlphaMapForGlyph(glyph_t glyphIndex, QFixed subPixe
if (!gset || gset->outline_drawing || !loadGlyph(gset, glyphIndex, subPixelPosition,
neededFormat)) {
+ default_hint_style = hintStyle;
return QFontEngine::lockedAlphaMapForGlyph(glyphIndex, subPixelPosition, neededFormat, t,
offset);
}
+ default_hint_style = hintStyle;
glyph = gset->getGlyph(glyphIndex, subPixelPosition);
} else {