From 00a8d21fff66cd2aec5ea0b6158a4f9923a6732f Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 21 Sep 2009 14:34:23 +0200 Subject: Fix printing with glyph substitution If a font has substituted any of the glyphs in the string, then we cannot convert it to a string, as the glyph positions will no longer match the positions of the characters. E.g. in the case of the MS Calibri font, two subsequent t's are represented by a single glyph. Printing text in Calibri with subsequent t's will thus cause the first t to be position and sized based on the glyph representing "tt" and glyphs after this to be position based on the wrong advance and the text will look mangled, with some glyphs overlapping. Task-number: QTBUG-4445 Reviewed-by: Gunnar --- src/gui/painting/qprintengine_win.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/painting/qprintengine_win.cpp b/src/gui/painting/qprintengine_win.cpp index e59155c..a3f94d9 100644 --- a/src/gui/painting/qprintengine_win.cpp +++ b/src/gui/painting/qprintengine_win.cpp @@ -374,6 +374,11 @@ void QWin32PrintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem convertToText = false; break; } + + if (ti.logClusters[i] != i) { + convertToText = false; + break; + } } COLORREF cf = RGB(qRed(brushColor), qGreen(brushColor), qBlue(brushColor)); -- cgit v0.12