summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qprintengine_win.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-09-21 12:34:23 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-09-21 13:24:14 (GMT)
commit00a8d21fff66cd2aec5ea0b6158a4f9923a6732f (patch)
tree00cbed3cf4e997ca166f357ce9c83f77ef292172 /src/gui/painting/qprintengine_win.cpp
parent8122c4fe6604caff016b2fe434a8e7065d025b1f (diff)
downloadQt-00a8d21fff66cd2aec5ea0b6158a4f9923a6732f.zip
Qt-00a8d21fff66cd2aec5ea0b6158a4f9923a6732f.tar.gz
Qt-00a8d21fff66cd2aec5ea0b6158a4f9923a6732f.tar.bz2
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
Diffstat (limited to 'src/gui/painting/qprintengine_win.cpp')
-rw-r--r--src/gui/painting/qprintengine_win.cpp5
1 files changed, 5 insertions, 0 deletions
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));