summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtextscriptengine
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2010-12-12 16:33:12 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2010-12-20 12:28:12 (GMT)
commit0189fc2335c891373ce595a4a01e4a9d73cc5fe4 (patch)
tree3c1997eaa72718423791e60a899fe5aff397b0d0 /tests/auto/qtextscriptengine
parent567bcd38dd7a749ac0bc3cdd2432798ab1af74fe (diff)
downloadQt-0189fc2335c891373ce595a4a01e4a9d73cc5fe4.zip
Qt-0189fc2335c891373ce595a4a01e4a9d73cc5fe4.tar.gz
Qt-0189fc2335c891373ce595a4a01e4a9d73cc5fe4.tar.bz2
Move advances for control character in Indic syllable shaping
When handling control characters (ZWJ, ZWNJ) in Indic syllables, we only moved glyphs and attributes of the item, advances should also be moved forward, otherwise we will use the advance of ZWJ/ ZWNJ for the part of syllable, which is normally zero, it results some positioning problems. Task-number: QTBUG-14204 Reviewed-by: Lars Knoll
Diffstat (limited to 'tests/auto/qtextscriptengine')
-rw-r--r--tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
index 0a7458f..b0b6b1e 100644
--- a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
+++ b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
@@ -103,6 +103,7 @@ private slots:
void khmer();
void linearB();
+ void controlInSyllable_qtbug14204();
};
tst_QTextScriptEngine::tst_QTextScriptEngine()
@@ -1111,6 +1112,22 @@ void tst_QTextScriptEngine::greek()
#endif
}
+void tst_QTextScriptEngine::controlInSyllable_qtbug14204()
+{
+ QString s;
+ s.append(QChar(0x0915));
+ s.append(QChar(0x094d));
+ s.append(QChar(0x200d));
+ s.append(QChar(0x0915));
+
+ QTextLayout layout(s);
+ QTextEngine *e = layout.d;
+ e->itemize();
+ e->shape(0);
+
+ QVERIFY(e->layoutData->items[0].num_glyphs == 2);
+ QVERIFY(e->layoutData->glyphLayout.advances_x[1] != 0);
+}
QTEST_MAIN(tst_QTextScriptEngine)
#include "tst_qtextscriptengine.moc"