Bug 1167281 - sort scalable fonts first when resolving generic families under Linux. r=karlt
--- a/gfx/thebes/gfxFcPlatformFontList.cpp
+++ b/gfx/thebes/gfxFcPlatformFontList.cpp
@@ -1349,16 +1349,19 @@ gfxFcPlatformFontList::FindGenericFamily
return genericFamily;
}
// if not found, ask fontconfig to pick the appropriate font
nsAutoRef<FcPattern> genericPattern(FcPatternCreate());
FcPatternAddString(genericPattern, FC_FAMILY,
ToFcChar8Ptr(generic.get()));
+ // -- prefer scalable fonts
+ FcPatternAddBool(genericPattern, FC_SCALABLE, FcTrue);
+
// -- add the lang to the pattern
if (!fcLang.IsEmpty()) {
FcPatternAddString(genericPattern, FC_LANG,
ToFcChar8Ptr(fcLang.get()));
}
// -- perform substitutions
FcConfigSubstitute(nullptr, genericPattern, FcMatchPattern);