diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-11-01 15:07:23 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-12-04 11:17:36 +0100 |
commit | 7bc6f4ae8edc5758af567d8326cb798d423c3982 (patch) | |
tree | 00043a0555855d649780246b54906d560dbd06d9 /src/gui/text/windows/qwindowsfontdatabasebase_p.h | |
parent | 5134b3ad54743e3a997ff27af112df79821e5ce1 (diff) |
Support arbitrary variable axis values
This adds API to set arbitrary values for axes in variable
fonts to QFont.
It also implements support for the API in CoreText, FreeType
(on all platforms) and DirectWrite.
Note that in order for the mechanism to work with
application fonts on DirectWrite, we need to keep the loader
for the fonts around for the life time of the font (otherwise
they cannot be reloaded with different parameters). The way
this was handled before (just re-creating and throwing away
the loader every time) was not ideal anyway, and this finally
gives us a good reason to fix it.
Fixes: QTBUG-119421
Fixes: QTBUG-117835
Fixes: QTBUG-117838
Fixes: QTBUG-117839
Change-Id: I3d1fe95fba1f9df52f34aa42e1ac5fa47dbe6d1a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/gui/text/windows/qwindowsfontdatabasebase_p.h')
-rw-r--r-- | src/gui/text/windows/qwindowsfontdatabasebase_p.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/text/windows/qwindowsfontdatabasebase_p.h b/src/gui/text/windows/qwindowsfontdatabasebase_p.h index b7bd47ba84..55a3363551 100644 --- a/src/gui/text/windows/qwindowsfontdatabasebase_p.h +++ b/src/gui/text/windows/qwindowsfontdatabasebase_p.h @@ -29,6 +29,10 @@ QT_BEGIN_NAMESPACE +#if QT_CONFIG(directwrite) + class QCustomFontFileLoader; +#endif + class QWindowsFontEngineData { Q_DISABLE_COPY_MOVE(QWindowsFontEngineData) @@ -56,6 +60,8 @@ public: QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) override; QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) override; + void invalidate() override; + static int defaultVerticalDPI(); static QSharedPointer<QWindowsFontEngineData> data(); @@ -98,6 +104,10 @@ protected: private: static bool init(QSharedPointer<QWindowsFontEngineData> data); + +#if QT_CONFIG(directwrite) + mutable std::unique_ptr<QCustomFontFileLoader> m_fontFileLoader; +#endif }; QT_END_NAMESPACE |