From 691cb20d95357cdaa7d158a3c26f3ca66cdbe537 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 25 Jun 2013 19:12:08 +0200 Subject: Add API to let applications integrate with the system fonts This patch does 2 things mainly: - Adds a QPlatformTheme font type for fixed fonts. It's important because some OS provide specific monospaced fonts and we want to let our applications to use the preferred fonts by default. - Adds a new method and enum to QFontDatabase that expose the font types that applications might need, so that they can make the applications use the specific fonts that the system recommends. This data was already available within Qt through the QPlatformTheme, but it was not possible to use this data by Qt users. This new method exposes such data. Change-Id: Ic194c1e4bc07a70640672afd82ba756b87606985 Reviewed-by: Jerome Pasion Reviewed-by: Friedemann Kleint Reviewed-by: David Faure (KDE) --- src/gui/text/qfontdatabase.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/gui/text/qfontdatabase.h') diff --git a/src/gui/text/qfontdatabase.h b/src/gui/text/qfontdatabase.h index 05f1a85f24..bd603c3c4a 100644 --- a/src/gui/text/qfontdatabase.h +++ b/src/gui/text/qfontdatabase.h @@ -60,6 +60,7 @@ class Q_GUI_EXPORT QFontDatabase { Q_GADGET Q_ENUMS(WritingSystem) + Q_ENUMS(SystemFont) public: // do not re-order or delete entries from this enum without updating the // QPF2 format and makeqpf!! @@ -106,6 +107,13 @@ public: WritingSystemsCount }; + enum SystemFont { + GeneralFont, + FixedFont, + TitleFont, + SmallestReadableFont + }; + static QList standardSizes(); QFontDatabase(); @@ -144,6 +152,8 @@ public: static bool supportsThreadedFontRendering(); + static QFont systemFont(SystemFont type); + private: static void createDatabase(); static void parseFontName(const QString &name, QString &foundry, QString &family); -- cgit v1.2.3