From 6da6845f078e419ccb555fe1dd152e0ba82a7e88 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Mon, 11 Jun 2012 12:46:17 +0200 Subject: Disable hinting for scaled glyphs in FreeType MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Friedemann Kleint --- src/gui/text/qfontengine_ft.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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 { -- cgit v1.2.3