1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
From 82bd2e1a51df0650cb40894c5dc2b958f601a91d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 16 May 2017 14:20:51 -0400
Subject: [PATCH] Compatibility with qt5-5.9.0
---
src/calibre/headless/fontconfig_database.cpp | 16 ++++++++++------
src/calibre/headless/fontconfig_database.h | 12 ++++++++----
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/src/calibre/headless/fontconfig_database.cpp b/src/calibre/headless/fontconfig_database.cpp
index 4e87b8f81b..33defd0b48 100644
--- a/src/calibre/headless/fontconfig_database.cpp
+++ b/src/calibre/headless/fontconfig_database.cpp
@@ -48,14 +48,18 @@
#include <qpa/qplatformservices.h>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
-#include <QtFontDatabaseSupport/private/qfontenginemultifontconfig_p.h>
+# include <QtFontDatabaseSupport/private/qfontenginemultifontconfig_p.h>
#else
-#include <QtPlatformSupport/private/qfontenginemultifontconfig_p.h>
+# include <QtPlatformSupport/private/qfontenginemultifontconfig_p.h>
+#endif
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
+# include <QtFontDatabaseSupport/private/qfontengine_ft_p.h>
+#else
+# include <QtGui/private/qfontengine_ft_p.h>
#endif
-#include <QtGui/private/qfontengine_ft_p.h>
#include <QtGui/private/qguiapplication_p.h>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
-#include <QtGui/private/qhighdpiscaling_p.h>
+# include <QtGui/private/qhighdpiscaling_p.h>
#endif
#include <QtGui/qguiapplication.h>
@@ -763,7 +767,7 @@ QFontEngine *QFontconfigDatabase::fontEngine(const QFontDef &f, void *usrPtr)
QFontEngine *QFontconfigDatabase::fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference)
{
- QFontEngineFT *engine = static_cast<QFontEngineFT*>(QBasicFontDatabase::fontEngine(fontData, pixelSize, hintingPreference));
+ QFontEngineFT *engine = static_cast<QFontEngineFT*>(QFreeTypeFontDatabase::fontEngine(fontData, pixelSize, hintingPreference));
if (engine == 0)
return 0;
@@ -915,7 +919,7 @@ QStringList QFontconfigDatabase::addApplicationFont(const QByteArray &fontData,
QString QFontconfigDatabase::resolveFontFamilyAlias(const QString &family) const
{
- QString resolved = QBasicFontDatabase::resolveFontFamilyAlias(family);
+ QString resolved = QFreeTypeFontDatabase::resolveFontFamilyAlias(family);
if (!resolved.isEmpty() && resolved != family)
return resolved;
FcPattern *pattern = FcPatternCreate();
diff --git a/src/calibre/headless/fontconfig_database.h b/src/calibre/headless/fontconfig_database.h
index e2fecff724..62afc129cf 100644
--- a/src/calibre/headless/fontconfig_database.h
+++ b/src/calibre/headless/fontconfig_database.h
@@ -7,17 +7,21 @@
#pragma once
#include <qpa/qplatformfontdatabase.h>
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
-#include <QtFontDatabaseSupport/private/qbasicfontdatabase_p.h>
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
+# include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h>
+#elif (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
+# include <QtFontDatabaseSupport/private/qbasicfontdatabase_p.h>
+# define QFreeTypeFontDatabase QBasicFontDatabase
#else
-#include <QtPlatformSupport/private/qbasicfontdatabase_p.h>
+# include <QtPlatformSupport/private/qbasicfontdatabase_p.h>
+# define QFreeTypeFontDatabase QBasicFontDatabase
#endif
QT_BEGIN_NAMESPACE
class QFontEngineFT;
-class QFontconfigDatabase : public QBasicFontDatabase
+class QFontconfigDatabase : public QFreeTypeFontDatabase
{
public:
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
|