summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/fontdatabases
diff options
context:
space:
mode:
authorMichaƂ Sawicz <michal.sawicz@canonical.com>2012-11-19 15:38:03 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-23 10:08:10 +0100
commit7a1eec36a277e9634273581270fce36e4e4b1c72 (patch)
treebea585bc6cd2e2e1961e70b665f9225fc6fdc23b /src/platformsupport/fontdatabases
parent603414525dff5cefa0798de1087f1ea1ff92910b (diff)
default to Regular font with FontConfig
Default to Regular/Normal instead of Medium in QFontConfigDatabase. Requesting Medium as default was fine until the font actually provided a Medium font, at which point it was selected by default. Tweak the buckets so that Medium has preference over Bold when DemiBold is requested. They will have to be extended for Medium when QTBUG-25814 is resolved. Change-Id: I111b7f99083d50c3e8264f84f10a997f619ef4b3 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/platformsupport/fontdatabases')
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
index 30237b3c5e..cf6ff11acd 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
@@ -84,11 +84,11 @@ static inline bool scriptRequiresOpenType(int script)
static int getFCWeight(int fc_weight)
{
int qtweight = QFont::Black;
- if (fc_weight <= (FC_WEIGHT_LIGHT + FC_WEIGHT_MEDIUM) / 2)
+ if (fc_weight <= (FC_WEIGHT_LIGHT + FC_WEIGHT_REGULAR) / 2)
qtweight = QFont::Light;
- else if (fc_weight <= (FC_WEIGHT_MEDIUM + FC_WEIGHT_DEMIBOLD) / 2)
+ else if (fc_weight <= (FC_WEIGHT_REGULAR + FC_WEIGHT_MEDIUM) / 2)
qtweight = QFont::Normal;
- else if (fc_weight <= (FC_WEIGHT_DEMIBOLD + FC_WEIGHT_BOLD) / 2)
+ else if (fc_weight <= (FC_WEIGHT_MEDIUM + FC_WEIGHT_BOLD) / 2)
qtweight = QFont::DemiBold;
else if (fc_weight <= (FC_WEIGHT_BOLD + FC_WEIGHT_BLACK) / 2)
qtweight = QFont::Bold;
@@ -350,7 +350,7 @@ void QFontconfigDatabase::populateFontDatabase()
// capitalize(value);
familyName = QString::fromUtf8((const char *)value);
slant_value = FC_SLANT_ROMAN;
- weight_value = FC_WEIGHT_MEDIUM;
+ weight_value = FC_WEIGHT_REGULAR;
spacing_value = FC_PROPORTIONAL;
file_value = 0;
indexValue = 0;
@@ -360,7 +360,7 @@ void QFontconfigDatabase::populateFontDatabase()
if (FcPatternGetInteger (fonts->fonts[i], FC_SLANT, 0, &slant_value) != FcResultMatch)
slant_value = FC_SLANT_ROMAN;
if (FcPatternGetInteger (fonts->fonts[i], FC_WEIGHT, 0, &weight_value) != FcResultMatch)
- weight_value = FC_WEIGHT_MEDIUM;
+ weight_value = FC_WEIGHT_REGULAR;
if (FcPatternGetInteger (fonts->fonts[i], FC_SPACING, 0, &spacing_value) != FcResultMatch)
spacing_value = FC_PROPORTIONAL;
if (FcPatternGetString (fonts->fonts[i], FC_FILE, 0, &file_value) != FcResultMatch)