diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-11 11:13:18 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-11 11:13:18 (GMT) |
commit | bea115b6a35959561d54cf994f6ba47e4367cfc6 (patch) | |
tree | 9d7af495b124edd89c0701adf67eb4685b0215c9 | |
parent | e76aae67ffdb9a67d04ee4e9909eece04c2bafcc (diff) | |
parent | 86e7893c2c1a4c316a1db510ab6abeafa7267c3d (diff) | |
download | Qt-bea115b6a35959561d54cf994f6ba47e4367cfc6.zip Qt-bea115b6a35959561d54cf994f6ba47e4367cfc6.tar.gz Qt-bea115b6a35959561d54cf994f6ba47e4367cfc6.tar.bz2 |
Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qt-fire-team
* 'master' of git://scm.dev.nokia.troll.no/qt/qt-fire-team:
Fix combining marks handling in Core Text shaper
-rw-r--r-- | src/gui/text/qfontengine_coretext.mm | 3 | ||||
-rw-r--r-- | tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp | 25 |
2 files changed, 26 insertions, 2 deletions
diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm index 2ae60b1..0209689 100644 --- a/src/gui/text/qfontengine_coretext.mm +++ b/src/gui/text/qfontengine_coretext.mm @@ -234,7 +234,8 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay int idx = rtlOffset + rtlSign * i; outGlyphs[idx] = tmpGlyphs[i] | fontIndex; outAdvances_x[idx] = QFixed::fromReal(tmpPoints[i + 1].x - tmpPoints[i].x); - outAdvances_y[idx] = QFixed::fromReal(tmpPoints[i + 1].y - tmpPoints[i].y); + // Use negative y advance for flipped coordinate system + outAdvances_y[idx] = QFixed::fromReal(tmpPoints[i].y - tmpPoints[i + 1].y); if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) { outAdvances_x[idx] = outAdvances_x[idx].round(); diff --git a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp index 91d0f3f..4f4e706a 100644 --- a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp +++ b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp @@ -56,7 +56,7 @@ -#if defined(Q_WS_X11) +#if defined(Q_WS_X11) || defined(Q_WS_MAC) #define private public #include <private/qtextengine_p.h> #include <qtextlayout.h> @@ -104,6 +104,7 @@ private slots: void khmer(); void linearB(); void controlInSyllable_qtbug14204(); + void combiningMarks_qtbug15675(); }; tst_QTextScriptEngine::tst_QTextScriptEngine() @@ -1133,5 +1134,27 @@ void tst_QTextScriptEngine::controlInSyllable_qtbug14204() #endif } +void tst_QTextScriptEngine::combiningMarks_qtbug15675() +{ +#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA) + QString s; + s.append(QChar(0x0061)); + s.append(QChar(0x0062)); + s.append(QChar(0x0300)); + s.append(QChar(0x0063)); + + QFont font("Monaco"); + QTextLayout layout(s, font); + QTextEngine *e = layout.d; + e->itemize(); + e->shape(0); + + QVERIFY(e->layoutData->items[0].num_glyphs == 4); + QVERIFY(e->layoutData->glyphLayout.advances_y[2] > 0); +#else + QSKIP("Mac specific test", SkipAll); +#endif +} + QTEST_MAIN(tst_QTextScriptEngine) #include "tst_qtextscriptengine.moc" |