Fix compilation with -no-directwrite
The refactoring for adding the DirectWrite font database broke disabling this feature, which in turn broke compilation with CMake, since the configure test isn't added there yet. Change-Id: I7727145112df7f1009a09f09bf3368645fb1b5da Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
7b0422d467
commit
15aade6c76
@ -564,6 +564,7 @@ QSharedPointer<QWindowsFontEngineData> QWindowsFontDatabaseBase::data()
|
|||||||
|
|
||||||
bool QWindowsFontDatabaseBase::init(QSharedPointer<QWindowsFontEngineData> d)
|
bool QWindowsFontDatabaseBase::init(QSharedPointer<QWindowsFontEngineData> d)
|
||||||
{
|
{
|
||||||
|
#if !defined(QT_NO_DIRECTWRITE)
|
||||||
if (!d->directWriteFactory) {
|
if (!d->directWriteFactory) {
|
||||||
createDirectWriteFactory(&d->directWriteFactory);
|
createDirectWriteFactory(&d->directWriteFactory);
|
||||||
if (!d->directWriteFactory)
|
if (!d->directWriteFactory)
|
||||||
@ -576,9 +577,11 @@ bool QWindowsFontDatabaseBase::init(QSharedPointer<QWindowsFontEngineData> d)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(QT_NO_DIRECTWRITE)
|
||||||
// ### Qt 6: Link directly to dwrite instead
|
// ### Qt 6: Link directly to dwrite instead
|
||||||
typedef HRESULT (WINAPI *DWriteCreateFactoryType)(DWRITE_FACTORY_TYPE, const IID &, IUnknown **);
|
typedef HRESULT (WINAPI *DWriteCreateFactoryType)(DWRITE_FACTORY_TYPE, const IID &, IUnknown **);
|
||||||
static inline DWriteCreateFactoryType resolveDWriteCreateFactory()
|
static inline DWriteCreateFactoryType resolveDWriteCreateFactory()
|
||||||
@ -619,6 +622,7 @@ void QWindowsFontDatabaseBase::createDirectWriteFactory(IDWriteFactory **factory
|
|||||||
|
|
||||||
*factory = static_cast<IDWriteFactory *>(result);
|
*factory = static_cast<IDWriteFactory *>(result);
|
||||||
}
|
}
|
||||||
|
#endif // !defined(QT_NO_DIRECTWRITE)
|
||||||
|
|
||||||
int QWindowsFontDatabaseBase::defaultVerticalDPI()
|
int QWindowsFontDatabaseBase::defaultVerticalDPI()
|
||||||
{
|
{
|
||||||
@ -853,7 +857,11 @@ QFontEngine *QWindowsFontDatabaseBase::fontEngine(const QByteArray &fontData, qr
|
|||||||
fontEngine->fontDef.hintingPreference = hintingPreference;
|
fontEngine->fontDef.hintingPreference = hintingPreference;
|
||||||
|
|
||||||
directWriteFontFace->Release();
|
directWriteFontFace->Release();
|
||||||
#endif // !defined(QT_NO_DIRECTWRITE)
|
#else // !defined(QT_NO_DIRECTWRITE)
|
||||||
|
Q_UNUSED(fontData);
|
||||||
|
Q_UNUSED(pixelSize);
|
||||||
|
Q_UNUSED(hintingPreference);
|
||||||
|
#endif
|
||||||
|
|
||||||
return fontEngine;
|
return fontEngine;
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,9 @@ public:
|
|||||||
|
|
||||||
static int defaultVerticalDPI();
|
static int defaultVerticalDPI();
|
||||||
static QSharedPointer<QWindowsFontEngineData> data();
|
static QSharedPointer<QWindowsFontEngineData> data();
|
||||||
|
#if !defined(QT_NO_DIRECTWRITE)
|
||||||
static void createDirectWriteFactory(IDWriteFactory **factory);
|
static void createDirectWriteFactory(IDWriteFactory **factory);
|
||||||
|
#endif
|
||||||
static QFont systemDefaultFont();
|
static QFont systemDefaultFont();
|
||||||
static HFONT systemFont();
|
static HFONT systemFont();
|
||||||
static LOGFONT fontDefToLOGFONT(const QFontDef &fontDef, const QString &faceName);
|
static LOGFONT fontDefToLOGFONT(const QFontDef &fontDef, const QString &faceName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user