diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-05-31 09:29:46 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-05-31 10:04:55 (GMT) |
commit | e159f97f6ecefb49d50a82b1084fd1b1b9e5e2cf (patch) | |
tree | 6bd195c69733b4a4aa8465be058dd19413dbc08e | |
parent | 48ff7e5af99923396243940979d15d4ec2e2730c (diff) | |
download | Qt-e159f97f6ecefb49d50a82b1084fd1b1b9e5e2cf.zip Qt-e159f97f6ecefb49d50a82b1084fd1b1b9e5e2cf.tar.gz Qt-e159f97f6ecefb49d50a82b1084fd1b1b9e5e2cf.tar.bz2 |
Fix glyph metrics with QStaticText/Freetype/raster and light/no hinting
This is a back-port of part of cad70d64d0bbada. In the raster engine's
drawCachedGlyphs(), which is used by QStaticText, we would use the wrong
metrics to lay out the glyphs, because loadGlyphMetrics() would assume
full hinting. A visible effect of this was that the baseline of rotated
text became wavy.
Task-number: QTBUG-18185
Reviewed-by: Jiang Jiang
-rw-r--r-- | src/gui/text/qfontengine_ft.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index c4e89d5..1056aed 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -762,9 +762,18 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyphMetrics(QGlyphSet *set, uint glyph return g; int load_flags = FT_LOAD_DEFAULT | default_load_flags; + int load_target = default_hint_style == HintLight + ? FT_LOAD_TARGET_LIGHT + : FT_LOAD_TARGET_NORMAL; + if (set->outline_drawing) load_flags = FT_LOAD_NO_BITMAP; + if (default_hint_style == HintNone) + load_flags |= FT_LOAD_NO_HINTING; + else + load_flags |= load_target; + // apply our matrix to this, but note that the metrics will not be affected by this. FT_Face face = lockFace(); FT_Matrix matrix = this->matrix; |