summaryrefslogtreecommitdiff
path: root/tests/auto/qtextscriptengine
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2012-01-16 15:39:56 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-18 18:07:00 +0100
commit44f415aafaf7eec56b31468a58e0ca768bbc082d (patch)
tree2919064359cc4eee32bec40ab23d49bdc59a57d4 /tests/auto/qtextscriptengine
parentba7a19727c42047048f16f155ce10c51c90fa1bc (diff)
downloadqt4-tools-44f415aafaf7eec56b31468a58e0ca768bbc082d.tar.gz
Fix isolated Thai SARA AM handling
Since 5e07a3ac58f93bd5e09715d43b58c20950c2befa Thai text layout is handled by libthai to special case of the SARA AM. It didn't handle isolated SARA AM. This patch fixed it and added detailed explaination on the special case. The dotted circle should be shown rather than hidden. Added a test case to verify that with Waree. Change-Id: I4967715627cbe15f5a3e9ab3e3844420ab541aed Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'tests/auto/qtextscriptengine')
-rw-r--r--tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
index 6a1aaad63d..eafbebd80a 100644
--- a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
+++ b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
@@ -111,6 +111,8 @@ private slots:
void mirroredChars_data();
void mirroredChars();
+
+ void thaiIsolatedSaraAm();
};
tst_QTextScriptEngine::tst_QTextScriptEngine()
@@ -1239,5 +1241,28 @@ void tst_QTextScriptEngine::mirroredChars()
}
}
+void tst_QTextScriptEngine::thaiIsolatedSaraAm()
+{
+ if (QFontDatabase().families(QFontDatabase::Any).contains("Waree")) {
+ QString s;
+ s.append(QChar(0x0e33));
+
+ QTextLayout layout(s, QFont("Waree"));
+ layout.beginLayout();
+ layout.createLine();
+ layout.endLayout();
+
+ QTextEngine *e = layout.engine();
+ e->itemize();
+ e->shape(0);
+
+ QCOMPARE(e->layoutData->items[0].num_glyphs, ushort(3));
+
+ unsigned short *logClusters = e->layoutData->logClustersPtr;
+ QCOMPARE(logClusters[0], ushort(0));
+ } else
+ QSKIP("Cannot find Waree.", SkipAll);
+}
+
QTEST_MAIN(tst_QTextScriptEngine)
#include "tst_qtextscriptengine.moc"