From 314da0ae017d664b3f05e6474f17c6610fb0257f Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Mon, 16 Jan 2012 15:39:56 +0100 Subject: 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 --- .../qtextscriptengine/tst_qtextscriptengine.cpp | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp') 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" -- cgit v1.2.3