diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2019-04-02 15:33:16 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2019-04-04 10:24:57 +0000 |
commit | bcd2fa484a4fe93e77743195d7f72cce9e580d43 (patch) | |
tree | cbe6501545af10348913756c98b4b2fa8b6cbae3 /src/gui/text/qplatformfontdatabase.cpp | |
parent | e2fdd7a9cbc6293c07b7c316b9ea3e9f4d6faf29 (diff) |
Fix font matching of typographic families on Windows
9204b8c31ea1b5f0c05870c5b5d74c33b1a4f622 broke font matching on Windows.
After this change, if you request a specific face of a family, such
as "Arial Black", and Qt detects that its typographic/preferred name
is "Arial", then it will be added as the single style of the Arial family,
which will in turn be set as populated=true.
So if you later request a regular font of "Arial" family, then it will
see that the family has already been populated, skip this step, and
then see that there is only one style available, i.e. "Arial Black".
To work around this, we need to make sure the typographic family is
properly populated the first time it is registered.
[ChangeLog][Windows][Fonts] Fixed a bug where it would be impossible
to request different faces of a font family after a specific type face
has been in use.
Task-number: QTBUG-74748
Change-Id: Ia0caace2b88a32e6114ff23ad10ee1ea8f5a3e03
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/gui/text/qplatformfontdatabase.cpp')
-rw-r--r-- | src/gui/text/qplatformfontdatabase.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp index a911014a19..715b00d838 100644 --- a/src/gui/text/qplatformfontdatabase.cpp +++ b/src/gui/text/qplatformfontdatabase.cpp @@ -60,6 +60,7 @@ void qt_registerFont(const QString &familyname, const QString &stylename, void qt_registerFontFamily(const QString &familyName); void qt_registerAliasToFontFamily(const QString &familyName, const QString &alias); +bool qt_isFontFamilyPopulated(const QString &familyName); /*! Registers the pre-rendered QPF2 font contained in the given \a dataArray. @@ -666,6 +667,16 @@ void QPlatformFontDatabase::registerAliasToFontFamily(const QString &familyName, } /*! + Helper function that returns true if the font family has already been registered and populated. + + \since 5.14 +*/ +bool QPlatformFontDatabase::isFamilyPopulated(const QString &familyName) +{ + return qt_isFontFamilyPopulated(familyName); +} + +/*! \class QPlatformFontDatabase \since 5.0 \internal |