diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2012-02-08 17:28:13 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-09 12:54:29 +0100 |
commit | 4af285c7d1be43b1882fb5b2ece8539622ea1b22 (patch) | |
tree | acd3d685ab002011d1a558f556d0504ac0d3292f /src/gui/text/qfontdatabase.cpp | |
parent | 581f079b04d4c1901d820304b3e9195e096e34e2 (diff) |
Preserve weight and style request for multi font engines
So that fallback fonts can pickup the weight/style requested instead
of using the weight and style of the primary font.
Change-Id: Ia592e079cad61334f21e0453412b198a900bb6b6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/gui/text/qfontdatabase.cpp')
-rw-r--r-- | src/gui/text/qfontdatabase.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 3ef28b8e50..e9b7d1a1dd 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -724,7 +724,7 @@ static void match(int script, const QFontDef &request, const QString &family_name, const QString &foundry_name, int force_encoding_id, QtFontDesc *desc, const QList<int> &blacklistedFamilies = QList<int>(), bool forceXLFD=false); -static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDef *fontDef) +static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDef *fontDef, bool multi) { fontDef->family = desc.family->name; if (! desc.foundry->name.isEmpty() && desc.family->count > 1) { @@ -743,8 +743,10 @@ static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDe fontDef->styleHint = request.styleHint; fontDef->styleStrategy = request.styleStrategy; - fontDef->weight = desc.style->key.weight; - fontDef->style = desc.style->key.style; + if (!multi) + fontDef->weight = desc.style->key.weight; + if (!multi) + fontDef->style = desc.style->key.style; fontDef->fixedPitch = desc.family->fixedPitch; fontDef->stretch = desc.style->key.stretch; fontDef->ignorePitch = false; |