From 7304c9a4e800f803221f99d5768ced03ca354654 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 8 Jul 2014 19:49:18 +0300 Subject: Make HarfBuzz-NG the default shaper on all platforms [ChangeLog][Important Behavior Changes] HarfBuzz-NG is now the default shaper on all platforms. This results in a better shaping results for various languages, better performance, and lower memory consumption. Task-number: QTBUG-18980 Change-Id: I4d9454fc37e9050873df3857e52369dfc7f191b2 Reviewed-by: Eskil Abrahamsen Blomfeldt --- configure | 39 ++++++++++++---------- .../qtextscriptengine/tst_qtextscriptengine.cpp | 15 ++------- tools/configure/configureapp.cpp | 19 ++++++----- 3 files changed, 34 insertions(+), 39 deletions(-) diff --git a/configure b/configure index ad0f29579b..82fefaa69a 100755 --- a/configure +++ b/configure @@ -617,7 +617,7 @@ CFG_EGL=auto CFG_EGL_X=auto CFG_FONTCONFIG=auto CFG_FREETYPE=auto -CFG_HARFBUZZ=auto +CFG_HARFBUZZ=qt CFG_SQL_AVAILABLE= QT_ALL_BUILD_PARTS=" libs tools examples tests " QT_DEFAULT_BUILD_PARTS="libs tools examples" @@ -2357,13 +2357,14 @@ Third Party Libraries: + -system-freetype.... Use the libfreetype provided by the system (enabled if -fontconfig is active). See http://www.freetype.org - * -no-harfbuzz ....... Do not compile HarfBuzz-NG support. - -qt-harfbuzz ....... (experimental) Use HarfBuzz-NG bundled with Qt + -no-harfbuzz ....... Do not compile HarfBuzz-NG support. + * -qt-harfbuzz ....... Use HarfBuzz-NG bundled with Qt to do text shaping. + It can still be disabled by setting + the QT_HARFBUZZ environment variable to "old". + -system-harfbuzz ... Use HarfBuzz-NG from the operating system to do text shaping. It can still be disabled - by setting QT_HARFBUZZ environment variable to "old". - -system-harfbuzz ... (experimental) Use HarfBuzz-NG from the operating system - to do text shaping. It can still be disabled - by setting QT_HARFBUZZ environment variable to "old". + by setting the QT_HARFBUZZ environment variable to "old". + See http://www.harfbuzz.org -no-openssl ........ Do not compile support for OpenSSL. + -openssl ........... Enable run-time OpenSSL support. @@ -5301,18 +5302,22 @@ if [ "$CFG_FREETYPE" = "auto" ]; then fi # harfbuzz support -[ "$XPLATFORM_MAC" = "yes" ] && [ "$CFG_HARFBUZZ" = "auto" ] && CFG_HARFBUZZ=yes -[ "$CFG_HARFBUZZ" = "auto" ] && CFG_HARFBUZZ=no # disable auto-detection on non-Mac for now -if [ "$CFG_HARFBUZZ" = "auto" ]; then - if compileTest unix/harfbuzz "HarfBuzz"; then - CFG_HARFBUZZ=system - else - CFG_HARFBUZZ=yes +if [ "$CFG_HARFBUZZ" = "system" ]; then + if ! compileTest unix/harfbuzz "HarfBuzz"; then + if [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then + echo " HarfBuzz system library support cannot be enabled due to functionality tests!" + echo " Turn on verbose messaging (-v) to $0 to see the final report." + echo " If you believe this message is in error you may use the continue" + echo " switch (-continue) to $0 to continue." + exit 101 + else + CFG_HARFBUZZ=qt + fi fi fi -if [ "$XPLATFORM_MAC" = "yes" -a "$CFG_HARFBUZZ" = "system" ]; then +if [ "$XPLATFORM_MAC" = "yes" -a "$CFG_HARFBUZZ" != "qt" ]; then echo - echo "WARNING: AAT is not supported with -system-harfbuzz on Mac OS X." + echo "WARNING: On OS X, AAT is supported only with -qt-harfbuzz." echo fi @@ -6542,7 +6547,7 @@ report_support " FontConfig ............." "$CFG_FONTCONFIG" report_support " FreeType ..............." "$CFG_FREETYPE" system "system library" yes "bundled copy" report_support " Glib ..................." "$CFG_GLIB" report_support " GTK theme .............." "$CFG_QGTKSTYLE" -report_support " HarfBuzz ..............." "$CFG_HARFBUZZ" +report_support " HarfBuzz ..............." "$CFG_HARFBUZZ" system "system library" qt "bundled copy" report_support " Iconv .................." "$CFG_ICONV" report_support " ICU ...................." "$CFG_ICU" report_support " Image formats:" diff --git a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp index 74eb58670b..40c6087882 100644 --- a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp +++ b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp @@ -1105,9 +1105,8 @@ void tst_QTextScriptEngine::mirroredChars() void tst_QTextScriptEngine::controlInSyllable_qtbug14204() { -#ifdef Q_OS_MAC QSKIP("Result differs for HarfBuzz-NG, skip test."); -#endif + QFontDatabase db; if (!db.families().contains(QStringLiteral("Aparajita"))) QSKIP("couldn't find 'Aparajita' font"); @@ -1146,9 +1145,7 @@ void tst_QTextScriptEngine::combiningMarks_qtbug15675_data() QTest::addColumn("font"); QTest::addColumn("string"); -#ifdef Q_OS_MAC QSKIP("Result differs for HarfBuzz-NG, skip test."); -#endif bool hasTests = false; @@ -1273,23 +1270,15 @@ void tst_QTextScriptEngine::thaiWithZWJ() QCOMPARE(logClusters[i], ushort(i)); QCOMPARE(logClusters[15], ushort(0)); QCOMPARE(logClusters[16], ushort(0)); -#ifndef Q_OS_MAC - // ### Result differs for HarfBuzz-NG - QCOMPARE(logClusters[17], ushort(1)); -#endif // A thai implementation could either remove the ZWJ and ZWNJ characters, or hide them. // The current implementation hides them, so we test for that. // The only characters that we should be hiding are the ZWJ and ZWNJ characters in position 1 and 3. const QGlyphLayout glyphLayout = e->layoutData->glyphLayout; for (int i = 0; i < 18; i++) { -#ifdef Q_OS_MAC - // ### Result differs for HarfBuzz-NG if (i == 17) QCOMPARE(glyphLayout.advances[i].toInt(), 0); - else -#endif - if (i == 1 || i == 3) + else if (i == 1 || i == 3) QCOMPARE(glyphLayout.advances[i].toInt(), 0); else QVERIFY(glyphLayout.advances[i].toInt() != 0); diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index b959caa56e..3471ed78ae 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -268,7 +268,7 @@ Configure::Configure(int& argc, char** argv) dictionary[ "LIBJPEG" ] = "auto"; dictionary[ "LIBPNG" ] = "auto"; dictionary[ "FREETYPE" ] = "yes"; - dictionary[ "HARFBUZZ" ] = "no"; + dictionary[ "HARFBUZZ" ] = "qt"; dictionary[ "ACCESSIBILITY" ] = "yes"; dictionary[ "OPENGL" ] = "yes"; @@ -607,7 +607,7 @@ void Configure::parseCmdLine() else if (configCmdLine.at(i) == "-no-harfbuzz") dictionary[ "HARFBUZZ" ] = "no"; else if (configCmdLine.at(i) == "-qt-harfbuzz") - dictionary[ "HARFBUZZ" ] = "yes"; + dictionary[ "HARFBUZZ" ] = "qt"; else if (configCmdLine.at(i) == "-system-harfbuzz") dictionary[ "HARFBUZZ" ] = "system"; @@ -1911,12 +1911,13 @@ bool Configure::displayHelp() desc("FREETYPE", "system","-system-freetype", "Use the libfreetype provided by the system."); desc("HARFBUZZ", "no", "-no-harfbuzz", "Do not compile in HarfBuzz-NG support."); - desc("HARFBUZZ", "yes", "-qt-harfbuzz", "(experimental) Use HarfBuzz-NG bundled with Qt\n" + desc("HARFBUZZ", "qt", "-qt-harfbuzz", "Use HarfBuzz-NG bundled with Qt to do text shaping.\n" + "It can still be disabled by setting\n" + "the QT_HARFBUZZ environment variable to \"old\"."); + desc("HARFBUZZ", "system","-system-harfbuzz", "Use HarfBuzz-NG from the operating system\n" "to do text shaping. It can still be disabled\n" - "by setting QT_HARFBUZZ environment variable to \"old\"."); - desc("HARFBUZZ", "system","-system-harfbuzz", "(experimental) Use HarfBuzz-NG from the operating system\n" - "to do text shaping. It can still be disabled\n" - "by setting QT_HARFBUZZ environment variable to \"old\".\n"); + "by setting the QT_HARFBUZZ environment variable to \"old\".\n" + "See http://www.harfbuzz.org\n"); if ((platform() == QNX) || (platform() == BLACKBERRY)) { desc("SLOG2", "yes", "-slog2", "Compile with slog2 support."); @@ -2696,7 +2697,7 @@ void Configure::generateOutputVars() else if (dictionary[ "FREETYPE" ] == "system") qtConfig += "system-freetype"; - if (dictionary[ "HARFBUZZ" ] == "yes") + if (dictionary[ "HARFBUZZ" ] == "qt") qtConfig += "harfbuzz"; else if (dictionary[ "HARFBUZZ" ] == "system") qtConfig += "system-harfbuzz"; @@ -3700,7 +3701,7 @@ void Configure::displayConfig() sout << " PNG support............." << dictionary[ "PNG" ] << endl; sout << " FreeType support........" << dictionary[ "FREETYPE" ] << endl; sout << " Fontconfig support......" << dictionary[ "FONT_CONFIG" ] << endl; - sout << " HarfBuzz-NG support....." << dictionary[ "HARFBUZZ" ] << endl; + sout << " HarfBuzz support........" << dictionary[ "HARFBUZZ" ] << endl; sout << " PCRE support............" << dictionary[ "PCRE" ] << endl; sout << " ICU support............." << dictionary[ "ICU" ] << endl; if ((platform() == QNX) || (platform() == BLACKBERRY)) { -- cgit v1.2.3