From 23553cccdaf42189fe2390f9b8082828fb1a5237 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 28 Oct 2014 12:36:45 +0100 Subject: [PATCH] Fix justification in multi fontengine glyphruns QTextLine::glyphRuns was not handling justification when splitting glyphRuns due to multiple font-engines. This patch adds the missing justification. Task-number: QTBUG-41901 Change-Id: I02d24218630506da21531a6499784dff2eecdf6f Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qtextlayout.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 911d1b8bc7..1ac50d3e5c 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2256,8 +2256,10 @@ QList QTextLine::glyphRuns(int from, int length) const logClusters, iterator.itemStart, iterator.itemLength)); - for (int i = 0; i < subLayout.numGlyphs; ++i) - pos.rx() += subLayout.advances[i].toReal(); + for (int i = 0; i < subLayout.numGlyphs; ++i) { + QFixed justification = QFixed::fromFixed(subLayout.justifications[i].space_18d6); + pos.rx() += (subLayout.advances[i] + justification).toReal(); + } if (rtl) end = start;