diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-09-12 15:52:06 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-09-16 11:26:07 +0200 |
commit | 7f0faddf9fe25adc0a3e0827e21c030d6a7a1035 (patch) | |
tree | 76e656f60357eeed9c567bca9263abbf47a98659 /src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h | |
parent | d20bacbb4cedf012566ce0020f9e53a7c1ecbe5f (diff) |
CoreText: Modernize style hint fallback lookup
The DefaultFontFallbacks.plist system file that we used for looking up
style fallbacks does not exists in macOS 10.15, nor did it ever exists
on iOS. Instead of relying on this file, we hard-code a set of default
families, that we then look up the fallbacks for.
The result of QFont::defaultFamily() on macOS is now:
QFont::Helvetica --> "Helvetica"
QFont::Times --> "Times New Roman"
QFont::Courier --> "American Typewriter"
QFont::OldEnglish --> ""
QFont::System --> "Lucida Grande"
QFont::AnyStyle --> "Lucida Grande"
QFont::Cursive --> "Apple Chancery"
QFont::Monospace --> "Menlo"
QFont::Fantasy --> "Zapfino"
And on iOS:
QFont::Helvetica --> "Helvetica"
QFont::Times --> "Times New Roman"
QFont::Courier --> "American Typewriter"
QFont::OldEnglish --> ""
QFont::System --> "Helvetica"
QFont::AnyStyle --> "Helvetica"
QFont::Cursive --> ""
QFont::Monospace --> "Menlo"
QFont::Fantasy --> "Zapfino"
Fixes: QTBUG-78240
Change-Id: Ie9bc13c9c1031d89f024199e4736a046c568a48d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h')
-rw-r--r-- | src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h index 05f6ed641c..45e74b99be 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h @@ -92,6 +92,7 @@ protected: private: void populateFromDescriptor(CTFontDescriptorRef font, const QString &familyName = QString()); + static QStringList fallbacksForFamily(const QString &family); mutable QString defaultFontName; |