diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2012-01-16 15:39:56 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-17 16:12:53 +0100 |
commit | 314da0ae017d664b3f05e6474f17c6610fb0257f (patch) | |
tree | e8fe21473418f6427f51844e9e3f6f35df298b68 /tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp | |
parent | 6e24833dc92d20e422e21dc59806ee4df6421164 (diff) |
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.
Add an test case to verify that with Waree.
Change-Id: I4967715627cbe15f5a3e9ab3e3844420ab541aed
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp')
-rw-r--r-- | tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp index 638f13aea2..73678585d6 100644 --- a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp +++ b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp @@ -103,6 +103,8 @@ private slots: void mirroredChars_data(); void mirroredChars(); + void thaiIsolatedSaraAm(); + private: bool haveTestFonts; }; @@ -1256,5 +1258,27 @@ 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."); +} + QTEST_MAIN(tst_QTextScriptEngine) #include "tst_qtextscriptengine.moc" |