summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2010-11-04 14:18:57 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2010-11-16 15:11:51 (GMT)
commite45c4387ae16627d61e30a58ae901d888d375aa7 (patch)
tree84a24d9650b5310ca0437c63979855b19e3ccdeb /tests
parent5803bf9c714bbfc9ecdee8b4fa8ebf87d9bfc4f4 (diff)
downloadQt-e45c4387ae16627d61e30a58ae901d888d375aa7.zip
Qt-e45c4387ae16627d61e30a58ae901d888d375aa7.tar.gz
Qt-e45c4387ae16627d61e30a58ae901d888d375aa7.tar.bz2
Fix bidi PDF mark support in Core Text shaper
When Core Text shaping a string like LRE ... PDF, it won't leave a zero width glyph for the PDF mark, it is not consistent with HarfBuzz and will cause issues in our text engine (the last glyph of the string will be considered as a ligature). This hack appended such a zero width glyph to fix that. Reviewed-by: Eskil
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qcomplextext/tst_qcomplextext.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qcomplextext/tst_qcomplextext.cpp b/tests/auto/qcomplextext/tst_qcomplextext.cpp
index fa8a2d1..c66d452 100644
--- a/tests/auto/qcomplextext/tst_qcomplextext.cpp
+++ b/tests/auto/qcomplextext/tst_qcomplextext.cpp
@@ -45,6 +45,7 @@
#if !defined(Q_WS_MAC)
#include <QtTest/QtTest>
+#include <QtGui/QtGui>
#include <private/qtextengine_p.h>
#include "bidireorderstring.h"
@@ -69,6 +70,7 @@ private slots:
void bidiReorderString_data();
void bidiReorderString();
void bidiCursor_qtbug2795();
+ void bidiCursor_PDF();
};
tst_QComplexText::tst_QComplexText()
@@ -183,6 +185,20 @@ void tst_QComplexText::bidiCursor_qtbug2795()
QVERIFY(x1 == x2);
}
+void tst_QComplexText::bidiCursor_PDF()
+{
+ QString str = QString::fromUtf8("\342\200\252hello\342\200\254");
+ QTextLayout layout(str);
+
+ layout.beginLayout();
+ QTextLine line = layout.createLine();
+ layout.endLayout();
+
+ int size = str.size();
+
+ QVERIFY(line.cursorToX(size) == line.cursorToX(size - 1));
+}
+
QTEST_MAIN(tst_QComplexText)
#include "tst_qcomplextext.moc"