From 4abffead71949870fef8b92a7a578352c6807298 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 8 Jun 2019 10:31:03 +0530 Subject: [PATCH] macOS: Fix loading of CoreText font database on newer Qt in the headless plugin --- src/calibre/headless/headless_integration.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/calibre/headless/headless_integration.cpp b/src/calibre/headless/headless_integration.cpp index 5363d87d15..7dc2fce583 100644 --- a/src/calibre/headless/headless_integration.cpp +++ b/src/calibre/headless/headless_integration.cpp @@ -4,6 +4,7 @@ #ifdef __APPLE__ #if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)) #include +class QCoreTextFontEngine; #else #include #endif @@ -37,6 +38,7 @@ QT_BEGIN_NAMESPACE + #ifndef __APPLE__ class GenericUnixServices : public QGenericUnixServices { /* We must return desktop environment as UNKNOWN otherwise other parts of @@ -64,7 +66,11 @@ HeadlessIntegration::HeadlessIntegration(const QStringList ¶meters) screenAdded(mPrimaryScreen); #ifdef __APPLE__ +#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) + m_fontDatabase.reset(new QCoreTextFontDatabaseEngineFactory()); +#else m_fontDatabase.reset(new QCoreTextFontDatabase()); +#endif #else m_fontDatabase.reset(new QFontconfigDatabase()); #endif