summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
diff options
context:
space:
mode:
authorJohn Tapsell <john.tapsell.ext@basyskom.com>2012-02-08 10:12:16 +0000
committerQt by Nokia <qt-info@nokia.com>2012-02-23 15:07:58 +0100
commit2b23d7214f1bb90369ee418a30958fcc5d96cd8f (patch)
tree32f57d64d34987276409ce7359284a1925c475b1 /tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
parent785e95ef0a95ca8fb39ef57678cd4876ee657c43 (diff)
QTextEngine - treat a fullstop (0x2E) as the same script as the preceeding text when dividing up strings
Many languages use a fullstop to indicate an abbreviation, making the fullstop part of the word. For languages like thai, it is required to pass the fullstop along for correct word breaking. Change-Id: I5ad0ddbc66ea96e08913446dad8fd3c5d5dd0905 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp')
-rw-r--r--tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
index 7db12ed2b4..7c9a83eaa4 100644
--- a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
+++ b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
@@ -1283,7 +1283,7 @@ void tst_QTextScriptEngine::thaiIsolatedSaraAm()
void tst_QTextScriptEngine::thaiWithZWJ()
{
- QString s(QString::fromUtf8("ร‍ร‌ร“ร…ร”ร\xA0ร本ร") + QChar(0x0363)/*superscript 'a', for testing Inherited class*/);
+ QString s(QString::fromUtf8("ร‍ร‌.ร.“ร…ร”ร\xA0ร本ร") + QChar(0x0363)/*superscript 'a', for testing Inherited class*/);
QTextLayout layout(s);
layout.beginLayout();
layout.createLine();
@@ -1296,7 +1296,7 @@ void tst_QTextScriptEngine::thaiWithZWJ()
// The current implementation hides them, so we test for that.
// But make sure that we don't hide anything else
QCOMPARE(e->layoutData->items.size(), 11);
- QCOMPARE(e->layoutData->items[0].num_glyphs, ushort(5)); // Thai: The ZWJ and ZWNJ characters are inherited, so should be part of the thai script
+ QCOMPARE(e->layoutData->items[0].num_glyphs, ushort(7)); // Thai: The ZWJ and ZWNJ characters are inherited, so should be part of the thai script
QCOMPARE(e->layoutData->items[1].num_glyphs, ushort(1)); // Common: The smart quotes cannot be handled by thai, so should be a seperate item
QCOMPARE(e->layoutData->items[2].num_glyphs, ushort(1)); // Thai: Thai character
QCOMPARE(e->layoutData->items[3].num_glyphs, ushort(1)); // Common: Ellipsis
@@ -1310,15 +1310,15 @@ void tst_QTextScriptEngine::thaiWithZWJ()
//A quick sanity check - check all the characters are individual clusters
unsigned short *logClusters = e->layoutData->logClustersPtr;
- for (int i = 0; i < 5; i++)
+ for (int i = 0; i < 7; i++)
QCOMPARE(logClusters[i], ushort(i));
for (int i = 0; i < 10; i++)
- QCOMPARE(logClusters[i+5], ushort(0));
- QCOMPARE(logClusters[15], ushort(1));
+ QCOMPARE(logClusters[i+7], ushort(0));
+ QCOMPARE(logClusters[17], ushort(1));
// The only characters that we should be hiding are the ZWJ and ZWNJ characters in position 1
// and 3.
- for (int i = 0; i < 16; i++)
+ for (int i = 0; i < 18; i++)
QCOMPARE((bool)e->layoutData->glyphLayout.attributes[i].dontPrint, (i == 1 || i == 3));
}