From: Eskil Abrahamsen Blomfeldt Date: Wed, 18 May 2011 10:16:33 +0000 (+0200) Subject: Fix broken drawing with large fonts using QStaticText and FreeType X-Git-Tag: qt-v5.0.0-alpha1~4294^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5fcd60f2560e8caf495ce67028a8da8bef27acad;p=profile%2Fivi%2Fqtbase.git Fix broken drawing with large fonts using QStaticText and FreeType In FreeType, there's a fall back to QFontEngine::alphaMapForGlyph() when the fonts are very large. Since this uses a QPainterPath containing an unhinted glyph, the use of hinted metrics would sometimes lead to the glyphs being clipped because they would be positioned slightly outside the image they were painted into. When outline drawing is on, it makes sense to return unhinted metrics, since the glyphs we will actually use are unhinted. Task-number: QTBUG-19067 Reviewed-by: Jiang Jiang --- diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 4dae2a3..855eaec 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -795,7 +795,7 @@ int QFontEngineFT::loadFlags(QGlyphSet *set, GlyphFormat format, int flags, if (set && set->outline_drawing) load_flags = FT_LOAD_NO_BITMAP; - if (default_hint_style == HintNone || (flags & HB_ShaperFlag_UseDesignMetrics)) + if (default_hint_style == HintNone || (flags & HB_ShaperFlag_UseDesignMetrics) || set->outline_drawing) load_flags |= FT_LOAD_NO_HINTING; else load_flags |= load_target;