diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-12-07 13:09:33 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2024-02-02 18:01:52 +0100 |
commit | 0916415ef7e909b7347c790c509280ae524482b7 (patch) | |
tree | ba3e62ef21c593675d85bf02a0d0a4fcb53ecb32 /tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp | |
parent | 16bcdba8e7adae79729c6347e711bd0a976dbbe7 (diff) |
Implement missing features in DirectWrite font backend
The DirectWrite font backend is an optional backend which
is planned to take over as the default on Windows. In order
to do this, though, a few gaps need to be filled in order
for it to pass all autotests.
The following things are covered by this:
1. Bitmap fonts are unsupported in DirectWrite. We enumerate
these using GDI and fall back to the GDI font engine when
loading them. As part of this, we introduce a new handle
type for fonts on Windows which can represent both
the DirectWrite and GDI engines.
2. "Legacy font names" where sub-family is embedded in the
family name is now enumerated together with the
typographic font name.
3. The DirectWrite font engine was not loading kerning pairs
from the font, like the other engines (omission which was
detected by the test)
4. Turning off antialiasing does not work with DirectWrite, so
we fall back to GDI for this.
5. Loading supported writing systems from application fonts
was not supported.
Task-number: QTBUG-119420
Change-Id: Icf6c351afb0d7487b2f4634199088d701a324aae
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp')
-rw-r--r-- | tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp index 3995f64e07..0f517a40d8 100644 --- a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp +++ b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp @@ -423,8 +423,10 @@ void tst_QFontDatabase::condensedFontMatching() QFont f; f.setStyleStrategy(QFont::NoFontMerging); QFontPrivate *font_d = QFontPrivate::get(f); - if (font_d->engineForScript(QChar::Script_Common)->type() != QFontEngine::Freetype) + if (font_d->engineForScript(QChar::Script_Common)->type() != QFontEngine::Freetype + && font_d->engineForScript(QChar::Script_Common)->type() != QFontEngine::DirectWrite) { QEXPECT_FAIL("","No matching of sub-family by stretch on Windows", Continue); + } #endif QCOMPARE(QFontMetrics(tfcByStretch).horizontalAdvance(testString()), |