diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2012-03-16 09:13:55 (GMT) |
---|---|---|
committer | Felix Geyer <debfx@fobos.de> | 2014-09-09 20:38:28 (GMT) |
commit | 80e3108f5cd1e1850ec81a21100d79a0946addd7 (patch) | |
tree | 21d5e3e8b3e4b0297c5ef49748954da1b1593392 /src/gui | |
parent | a10768455352eb3e49b2123234cd096a032d3474 (diff) | |
download | Qt-80e3108f5cd1e1850ec81a21100d79a0946addd7.zip Qt-80e3108f5cd1e1850ec81a21100d79a0946addd7.tar.gz Qt-80e3108f5cd1e1850ec81a21100d79a0946addd7.tar.bz2 |
Fix font cache check in QFontEngineFT::recalcAdvances()
Cached font was used regardless of the format, resulting in incorrect
advance in some cases when default format differed from the cached
format.
Task-number: QTBUG-24188
Change-Id: I39e4156bd9ba743afa7e106e934c90227fbf2b8b
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
(cherry picked from qtbase/2ea976c3a713535c2419d936d575e0b24545f0fa)
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
Reviewed-by: Jiang Jiang <gzjjgod@gmail.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qfontengine_ft.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index aecbf76..44a0aca 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1603,7 +1603,9 @@ void QFontEngineFT::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlag (flags & HB_ShaperFlag_UseDesignMetrics)) && FT_IS_SCALABLE(freetype->face); for (int i = 0; i < glyphs->numGlyphs; i++) { Glyph *g = defaultGlyphSet.getGlyph(glyphs->glyphs[i]); - if (g) { + // Since we are passing Format_None to loadGlyph, use same default format logic as loadGlyph + GlyphFormat acceptableFormat = (defaultFormat != Format_None) ? defaultFormat : Format_Mono; + if (g && g->format == acceptableFormat) { glyphs->advances_x[i] = design ? QFixed::fromFixed(g->linearAdvance) : QFixed(g->advance); } else { if (!face) |