diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-02-18 09:18:49 (GMT) |
---|---|---|
committer | Jiang Jiang <jiang.jiang@nokia.com> | 2011-03-14 10:28:09 (GMT) |
commit | 57bda4d3139edeb76689ac64a8c36e5551093bf9 (patch) | |
tree | c3d911e178e94acdb0018338ed02d43b12fb0a03 /tests/auto/qtextscriptengine | |
parent | c0fed43b04dec8bd549043d3ea5e28908128082c (diff) | |
download | Qt-57bda4d3139edeb76689ac64a8c36e5551093bf9.zip Qt-57bda4d3139edeb76689ac64a8c36e5551093bf9.tar.gz Qt-57bda4d3139edeb76689ac64a8c36e5551093bf9.tar.bz2 |
Fix combining marks shaping without GPOS feature in HarfBuzz
For certain OpenType fonts like DejaVu Sans Mono, not all
combining marks has GPOS feature applied, U+0062 U+0332
is one of the case. Only getting the advances for indivivual
glyphs is not enough, we should also do heuristic positioning
to put the combining mark in the right place.
Task-number: QTBUG-15675
Reviewed-by: Lars Knoll
Diffstat (limited to 'tests/auto/qtextscriptengine')
-rw-r--r-- | tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp index 07da68d..54c07a2 100644 --- a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp +++ b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp @@ -1157,8 +1157,28 @@ void tst_QTextScriptEngine::combiningMarks_qtbug15675() QVERIFY(e->layoutData->items[0].num_glyphs == 4); QVERIFY(e->layoutData->glyphLayout.advances_y[2] > 0); +#elif defined(Q_WS_X11) + QFontDatabase db; + + if (!db.families().contains("DejaVu Sans Mono")) { + QSKIP("Required font (DejaVu Sans Mono) doesn't exist, skip test.", SkipAll); + return; + } + + QString s; + s.append(QChar(0x0062)); + s.append(QChar(0x0332)); + s.append(QChar(0x0063)); + + QTextLayout layout(s, QFont("DejaVu Sans Mono")); + QTextEngine *e = layout.d; + e->itemize(); + e->shape(0); + + QVERIFY(e->layoutData->items[0].num_glyphs == 3); + QVERIFY(e->layoutData->glyphLayout.advances_x[1] == 0); #else - QSKIP("Mac specific test", SkipAll); + QSKIP("X11/Mac specific test", SkipAll); #endif } |