Bug 1167281 - sort scalable fonts first when resolving generic families under Linux. r=karlt
authorJohn Daggett <jdaggett@mozilla.com>
Wed, 27 May 2015 16:19:27 +0900
changeset 268026 120ff7bb304abf390596926bf4ced675c2f77b50
parent 268025 a727cfdf0133179aca069a5bd0a38fbfc2a44b5e
child 268027 ec2a1ba41a7a353443218fc7805ba3be8ba02a28
push id2294
push userbsmedberg@mozilla.com
push dateWed, 27 May 2015 15:05:10 +0000
reviewerskarlt
bugs1167281
milestone41.0a1
Bug 1167281 - sort scalable fonts first when resolving generic families under Linux. r=karlt
gfx/thebes/gfxFcPlatformFontList.cpp
--- 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);