diff options
author | Eskil Abrahamsen Blomfeldt <[email protected]> | 2024-03-18 07:57:40 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <[email protected]> | 2024-04-17 10:55:57 +0200 |
commit | a78a8e7340307709ea644db052004b83ecaa767e (patch) | |
tree | d038f8db25d47731c7403de1dcc10ca71c280290 | |
parent | 36c0a2ab904dc600c62e30d6473cfd6cbb725405 (diff) |
Revert "Don't do font merging for PUA characters"
This reverts commit fc33fea999365c36ed446eee0db0d59d94be306b.
The change caused issues with system-wide PUA fallbacks on
platforms where this is supported. It needs to be replaced by
an approach which still falls back, but only for fonts which
are explicitly categorized as PUA fallbacks.
Task-number: QTBUG-110502
Change-Id: I985a1f8076645593c50e81759872b4227d0fcd0d
Reviewed-by: Tor Arne Vestbø <[email protected]>
(cherry picked from commit 4913511d3bf8ec7838f80fbfe92c0fe900b2f003)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
(cherry picked from commit 5b3fd5e9d217a1ed7581e1e08bec2ab9641e7bcd)
Reviewed-by: Mårten Nordheim <[email protected]>
-rw-r--r-- | src/gui/text/qfontengine.cpp | 3 | ||||
-rw-r--r-- | tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp | 39 |
2 files changed, 1 insertions, 41 deletions
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 6cd7c3fe37e..a842d6b800e 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -1862,8 +1862,7 @@ bool QFontEngineMulti::stringToCMap(const QChar *str, int len, && ucs4 != QChar::LineSeparator && ucs4 != QChar::LineFeed && ucs4 != QChar::CarriageReturn - && ucs4 != QChar::ParagraphSeparator - && QChar::category(ucs4) != QChar::Other_PrivateUse) { + && ucs4 != QChar::ParagraphSeparator) { if (!m_fallbackFamiliesQueried) const_cast<QFontEngineMulti *>(this)->ensureFallbackFamiliesQueried(); for (int x = 1, n = qMin(m_engines.size(), 256); x < n; ++x) { diff --git a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp index 43cb6667ec5..d729cfbf6ee 100644 --- a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp +++ b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp @@ -56,9 +56,6 @@ private slots: void shapingDisabledDevanagari(); void shapingDisabledLatin(); - - void privateUseArea(); - private: bool haveTestFonts; }; @@ -1316,41 +1313,5 @@ void tst_QTextScriptEngine::shapingDisabledDevanagari() QCOMPARE(noShapingRuns.first().glyphIndexes().size(), normalRuns.first().glyphIndexes().size()); } -void tst_QTextScriptEngine::privateUseArea() -{ - QString privateUseAreaString = QString::fromUtf8(""); - - QFont font; - QList<QGlyphRun> withFontMerging; - { - QTextLayout layout; - layout.setText(privateUseAreaString); - layout.setFont(font); - layout.beginLayout(); - layout.createLine(); - layout.endLayout(); - - withFontMerging = layout.glyphRuns(); - } - - font.setStyleStrategy(QFont::NoFontMerging); - QList<QGlyphRun> withoutFontMerging; - { - QTextLayout layout; - layout.setText(privateUseAreaString); - layout.setFont(font); - layout.beginLayout(); - layout.createLine(); - layout.endLayout(); - - withoutFontMerging = layout.glyphRuns(); - } - - QCOMPARE(withFontMerging.size(), withoutFontMerging.size()); - - for (int i = 0; i < withFontMerging.size(); ++i) - QCOMPARE(withFontMerging.at(i).glyphIndexes(), withoutFontMerging.at(i).glyphIndexes()); -} - QTEST_MAIN(tst_QTextScriptEngine) #include "tst_qtextscriptengine.moc" |