diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-08-18 09:00:21 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-10-02 18:00:33 +0200 |
commit | 500be123f4fbb60593fe25d5fe70fbc62445e8aa (patch) | |
tree | 7f6d70578e2a06075619e4c98a3ea62d136c2637 /tests/auto/gui | |
parent | 0138d910b2a249f27a824d5cbead0b034d5b2918 (diff) |
Support variable applications fonts with DirectWrite
For GDI, there doesn't seem to be any way to do this, so it depends
on selecting the DirectWrite font database explicitly.
This moves the supportsVariableApplicationFonts() check into the
QPlatformFontDatabase instead of the font engine, since that's
where it belongs.
[ChangeLog][Fonts] Added support for selecting named instances in
variable application fonts when using the DirectWrite backend.
Task-number: QTBUG-108624
Change-Id: I51e0fedd7a9616088a06453a1d17f48bd18fa5a7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/gui')
-rw-r--r-- | tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp index 81c402cd89..fb61037c95 100644 --- a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp +++ b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp @@ -12,6 +12,9 @@ #include <private/qfont_p.h> #include <private/qfontengine_p.h> #include <qpa/qplatformfontdatabase.h> +#include <qpa/qplatformintegration.h> + +#include <QtGui/private/qguiapplication_p.h> using namespace Qt::StringLiterals; @@ -513,11 +516,9 @@ void tst_QFontDatabase::findCourier() void tst_QFontDatabase::variableFont() { { - QFont f; - f.setStyleStrategy(QFont::NoFontMerging); - QFontPrivate *font_d = QFontPrivate::get(f); - if (!font_d->engineForScript(QChar::Script_Common)->supportsVariableApplicationFonts()) - QSKIP("Variable application fonts only supported on Freetype currently"); + QPlatformFontDatabase *pfdb = QGuiApplicationPrivate::platformIntegration()->fontDatabase(); + if (!pfdb->supportsVariableApplicationFonts()) + QSKIP("Variable application fonts not supported on this platform"); } int id = QFontDatabase::addApplicationFont(m_testFontVariable); |