summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2010-12-12 17:33:12 +0100
committerQt Commercial Integration <QtCommercial@digia.com>2012-01-31 12:24:46 +0200
commit48138e019036f5bd65e16557ad2a9414292b850d (patch)
treebcbd5571f2bd8f6927d98dfb83f2088d2ac4eb13 /tests
parent152a14cd73e478685833dd0c8ae29583d898ce82 (diff)
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')
-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 3c26e5477b..1b3645fbf1 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"