diff --git a/src/gui/text/unix/qfontconfigdatabase.cpp b/src/gui/text/unix/qfontconfigdatabase.cpp index 5294278369f..2b5ac3fa4b9 100644 --- a/src/gui/text/unix/qfontconfigdatabase.cpp +++ b/src/gui/text/unix/qfontconfigdatabase.cpp @@ -474,13 +474,12 @@ static void populateFromPattern(FcPattern *pattern, if (!scalable) FcPatternGetDouble (pattern, FC_PIXEL_SIZE, 0, &pixel_size); - bool fixedPitch = spacing_value >= FC_MONO; + bool isMonospace = spacing_value >= FC_DUAL; FcBool colorFont = false; #ifdef FC_COLOR FcPatternGetBool(pattern, FC_COLOR, 1, &colorFont); #endif - // Note: stretch should really be an int but registerFont incorrectly uses an enum QFont::Stretch stretch = QFont::Stretch(stretchFromFcWidth(width_value)); QString styleName = style_value ? QString::fromUtf8((const char *) style_value) : QString(); @@ -496,7 +495,7 @@ static void populateFromPattern(FcPattern *pattern, applicationFont->properties.append(properties); } - QPlatformFontDatabase::registerFont(familyName,styleName,QLatin1StringView((const char *)foundry_value),weight,style,stretch,antialias,scalable,pixel_size,fixedPitch,colorFont,writingSystems,fontFile); + QPlatformFontDatabase::registerFont(familyName,styleName,QLatin1StringView((const char *)foundry_value),weight,style,stretch,antialias,scalable,pixel_size,isMonospace,colorFont,writingSystems,fontFile); if (applicationFont != nullptr && face != nullptr && db != nullptr) { db->addNamedInstancesForFace(face, indexValue, @@ -505,7 +504,7 @@ static void populateFromPattern(FcPattern *pattern, weight, stretch, style, - fixedPitch, + isMonospace, colorFont, writingSystems, QByteArray((const char*)file_value), @@ -543,7 +542,7 @@ static void populateFromPattern(FcPattern *pattern, applicationFont->properties.append(properties); } FontFile *altFontFile = new FontFile(*fontFile); - QPlatformFontDatabase::registerFont(altFamilyName, altStyleName, QLatin1StringView((const char *)foundry_value),weight,style,stretch,antialias,scalable,pixel_size,fixedPitch,colorFont,writingSystems,altFontFile); + QPlatformFontDatabase::registerFont(altFamilyName, altStyleName, QLatin1StringView((const char *)foundry_value),weight,style,stretch,antialias,scalable,pixel_size,isMonospace,colorFont,writingSystems,altFontFile); } else { QPlatformFontDatabase::registerAliasToFontFamily(familyName, altFamilyName); }