From a02750d12f84a5c7dcc72be6b71fac517b82ca09 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Thu, 8 Dec 2022 11:29:17 +0100 Subject: [PATCH] Isolate freetype feature If freetype feature is not enabled we don't deliver its header files as part of Qt. The freetype font database was used as the generic fontdata base for unix platforms. This uses QPlatformFontDatabase as the generic one if neither fontconfig nor freetype features are enabled. Fixes: QTBUG-109270 Change-Id: I9e935fd1557db417eb94d44b6a0d88818d567fbe Reviewed-by: Alexandru Croitor Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: Qt CI Bot --- src/gui/CMakeLists.txt | 2 +- src/gui/text/unix/qgenericunixfontdatabase_p.h | 7 +++++-- src/plugins/platforms/minimal/qminimalintegration.cpp | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index b72e65dd283..a8e4d127185 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -748,7 +748,7 @@ qt_internal_extend_target(Gui CONDITION QT_FEATURE_freetype WrapFreetype::WrapFreetype ) -qt_internal_extend_target(Gui CONDITION QT_FEATURE_freetype AND UNIX AND NOT APPLE +qt_internal_extend_target(Gui CONDITION UNIX AND NOT APPLE SOURCES text/unix/qgenericunixfontdatabase_p.h ) diff --git a/src/gui/text/unix/qgenericunixfontdatabase_p.h b/src/gui/text/unix/qgenericunixfontdatabase_p.h index 10d5c988fb2..96124d025b4 100644 --- a/src/gui/text/unix/qgenericunixfontdatabase_p.h +++ b/src/gui/text/unix/qgenericunixfontdatabase_p.h @@ -20,9 +20,12 @@ #if QT_CONFIG(fontconfig) #include using QGenericUnixFontDatabase = QFontconfigDatabase; -#else +#elif QT_CONFIG(freetype) #include using QGenericUnixFontDatabase = QFreeTypeFontDatabase; -#endif //Q_FONTCONFIGDATABASE +#else +#include +using QGenericUnixFontDatabase = QPlatformFontDatabase; +#endif #endif // QGENERICUNIXFONTDATABASE_H diff --git a/src/plugins/platforms/minimal/qminimalintegration.cpp b/src/plugins/platforms/minimal/qminimalintegration.cpp index 240d943f4d9..46799674310 100644 --- a/src/plugins/platforms/minimal/qminimalintegration.cpp +++ b/src/plugins/platforms/minimal/qminimalintegration.cpp @@ -6,11 +6,11 @@ #include #include +#include #include #include #include -#include #if defined(Q_OS_WIN) # include # if QT_CONFIG(freetype) @@ -22,11 +22,11 @@ #if QT_CONFIG(fontconfig) # include -# include #endif #if QT_CONFIG(freetype) #include +#include #endif #if !defined(Q_OS_WIN)