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>
bb10
Jiang Jiang 2012-06-11 12:46:17 +02:00 committed by Qt by Nokia
parent cb97d846e2
commit 6da6845f07
1 changed files with 5 additions and 0 deletions

View File

@ -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 {