]>
Commit | Line | Data |
---|---|---|
edb488de AM |
1 | From 80e3108f5cd1e1850ec81a21100d79a0946addd7 Mon Sep 17 00:00:00 2001 |
2 | From: Miikka Heikkinen <miikka.heikkinen@digia.com> | |
3 | Date: Fri, 16 Mar 2012 11:13:55 +0200 | |
4 | Subject: [PATCH 72/74] Fix font cache check in QFontEngineFT::recalcAdvances() | |
5 | MIME-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ||
9 | Cached font was used regardless of the format, resulting in incorrect | |
10 | advance in some cases when default format differed from the cached | |
11 | format. | |
12 | ||
13 | Task-number: QTBUG-24188 | |
14 | Change-Id: I39e4156bd9ba743afa7e106e934c90227fbf2b8b | |
15 | Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com> | |
16 | (cherry picked from qtbase/2ea976c3a713535c2419d936d575e0b24545f0fa) | |
17 | Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> | |
18 | Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com> | |
19 | Reviewed-by: Jiang Jiang <gzjjgod@gmail.com> | |
20 | --- | |
21 | src/gui/text/qfontengine_ft.cpp | 4 +++- | |
22 | 1 file changed, 3 insertions(+), 1 deletion(-) | |
23 | ||
24 | diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp | |
25 | index aecbf76..44a0aca 100644 | |
26 | --- a/src/gui/text/qfontengine_ft.cpp | |
27 | +++ b/src/gui/text/qfontengine_ft.cpp | |
28 | @@ -1603,7 +1603,9 @@ void QFontEngineFT::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlag | |
29 | (flags & HB_ShaperFlag_UseDesignMetrics)) && FT_IS_SCALABLE(freetype->face); | |
30 | for (int i = 0; i < glyphs->numGlyphs; i++) { | |
31 | Glyph *g = defaultGlyphSet.getGlyph(glyphs->glyphs[i]); | |
32 | - if (g) { | |
33 | + // Since we are passing Format_None to loadGlyph, use same default format logic as loadGlyph | |
34 | + GlyphFormat acceptableFormat = (defaultFormat != Format_None) ? defaultFormat : Format_Mono; | |
35 | + if (g && g->format == acceptableFormat) { | |
36 | glyphs->advances_x[i] = design ? QFixed::fromFixed(g->linearAdvance) : QFixed(g->advance); | |
37 | } else { | |
38 | if (!face) | |
39 | -- | |
40 | 1.9.3 | |
41 |