summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2019-04-05 11:48:29 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-02-04 10:19:12 +0100
commit35262678c31a4aea0df1516c565cf9a2e808b369 (patch)
treeedb489ea1d6ee09459ec2edcab461c04c3cd7ae4 /src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
parenta13e8d6660913bec172d1374f78083498c539df0 (diff)
Experimental DirectWrite font database
Adds an opt-in experimental DirectWrite-based font database. This cannot be the 100% replacement for GDI unfortunately, since quite a few font formats used on Windows are still unsupported. But it would be good to have it as an opt-in experimental feature since it should make it easier to solve multiple font selection issues we have on Windows. In order to still share the DirectWrite-specific code between the old and new database, this introduces a common base class. Note that the feature depends on DirectWrite 3 support (Windows 10). Fixes: QTBUG-74917 Change-Id: Ida08ec7ef4fda9fc78622ca4297909a727390a64 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h')
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h37
1 files changed, 3 insertions, 34 deletions
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
index f132e69d4d..a76fdc0810 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
@@ -51,39 +51,16 @@
// We mean it.
//
+#include "qwindowsfontdatabasebase_p.h"
+
#include <qpa/qplatformfontdatabase.h>
#include <QtCore/QSharedPointer>
#include <QtCore/QLoggingCategory>
#include <QtCore/qt_windows.h>
-#if !defined(QT_NO_DIRECTWRITE)
- struct IDWriteFactory;
- struct IDWriteGdiInterop;
-#endif
-
QT_BEGIN_NAMESPACE
-Q_DECLARE_LOGGING_CATEGORY(lcQpaFonts)
-
-class QWindowsFontEngineData
-{
- Q_DISABLE_COPY_MOVE(QWindowsFontEngineData)
-public:
- QWindowsFontEngineData();
- ~QWindowsFontEngineData();
-
- uint pow_gamma[256];
-
- bool clearTypeEnabled = false;
- qreal fontSmoothingGamma;
- HDC hdc = 0;
-#if !defined(QT_NO_DIRECTWRITE)
- IDWriteFactory *directWriteFactory = nullptr;
- IDWriteGdiInterop *directWriteGdiInterop = nullptr;
-#endif
-};
-
-class QWindowsFontDatabase : public QPlatformFontDatabase
+class QWindowsFontDatabase : public QWindowsFontDatabaseBase
{
Q_DISABLE_COPY_MOVE(QWindowsFontDatabase)
public:
@@ -113,23 +90,15 @@ public:
void refUniqueFont(const QString &uniqueFont);
bool isPrivateFontFamily(const QString &family) const override;
- static QFont systemDefaultFont();
-
static QFontEngine *createEngine(const QFontDef &request, const QString &faceName,
int dpi,
const QSharedPointer<QWindowsFontEngineData> &data);
- static HFONT systemFont();
- static QFont LOGFONT_to_QFont(const LOGFONT& lf, int verticalDPI = 0);
-
static qreal fontSmoothingGamma();
- static LOGFONT fontDefToLOGFONT(const QFontDef &fontDef, const QString &faceName);
static QStringList extraTryFontsForFamily(const QString &family);
static QString familyForStyleHint(QFont::StyleHint styleHint);
- static int defaultVerticalDPI();
-
static void setFontOptions(unsigned options);
static unsigned fontOptions();