From 753b472cb851bf12033b1e3ae663b4bdd056d1ef Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 3 Jan 2014 12:27:02 +0100 Subject: REG: Fix support for strings spanning multiple font engines E.g. in the case where the first char in a font got a font engine index != 0, and the second character got font engine index == 0, we would not count the second character as a separate glyph run. The result would be that its glyph indexes would refer to font #0, but the font used to render them would be the same as for the first character, i.e. random. Task-number: QTBUG-35740 [ChangeLog][Text][QTBUG-35740] Fixed regression when shaping some strings containing characters from multiple fonts. Change-Id: I668804045c8b276787c7b256bc87916c467f3f59 Reviewed-by: Konstantin Ritt --- src/gui/text/qtextengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 4e1c8c4c4a..06c5e24920 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -954,12 +954,12 @@ void QTextEngine::shapeText(int item) const itemBoundaries.append(i); itemBoundaries.append(glyph_pos); - lastEngine = engineIdx; QFontEngine *actualFontEngine = static_cast(fontEngine)->engine(engineIdx); si.ascent = qMax(actualFontEngine->ascent(), si.ascent); si.descent = qMax(actualFontEngine->descent(), si.descent); si.leading = qMax(actualFontEngine->leading(), si.leading); } + lastEngine = engineIdx; if (QChar::isHighSurrogate(string[i]) && i + 1 < itemLength && QChar::isLowSurrogate(string[i + 1])) ++i; } -- cgit v1.2.3