summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfont.h
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@digia.com>2014-10-22 17:14:29 +0200
committerKonstantin Ritt <ritt.ks@gmail.com>2014-12-12 06:59:46 +0100
commit517da68893be9e6d97c7993922c573de9560604d (patch)
tree9da6027604c97023fd6cacc3114c2f2fd43dd26f /src/gui/text/qfont.h
parent0478bc15bd3b4c616b4860e460600ba8877ee216 (diff)
Add QFont::Weight enum values
And try to make good use of them in order to match the QFont request more closely. Task-number: QTBUG-38482 Change-Id: I768dfa8828e370d77a1c17ecf4796d750b3edd9b Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Diffstat (limited to 'src/gui/text/qfont.h')
-rw-r--r--src/gui/text/qfont.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h
index 2a84fa680d..df2815ae73 100644
--- a/src/gui/text/qfont.h
+++ b/src/gui/text/qfont.h
@@ -86,12 +86,17 @@ public:
PreferFullHinting = 3
};
+ // Mapping OpenType weight value.
enum Weight {
- Light = 25,
- Normal = 50,
- DemiBold = 63,
- Bold = 75,
- Black = 87
+ Thin = 0, // 100
+ ExtraLight = 12, // 200
+ Light = 25, // 300
+ Normal = 50, // 400
+ Medium = 57, // 500
+ DemiBold = 63, // 600
+ Bold = 75, // 700
+ ExtraBold = 81, // 800
+ Black = 87 // 900
};
enum Style {
@@ -313,7 +318,7 @@ Q_DECLARE_SHARED(QFont)
Q_GUI_EXPORT uint qHash(const QFont &font, uint seed = 0) Q_DECL_NOTHROW;
inline bool QFont::bold() const
-{ return weight() > Normal; }
+{ return weight() > Medium; }
inline void QFont::setBold(bool enable)