FontConfig character/lang match requires weak family.
In FontConfig the normal priority order of matches is character, family,
language; however family can be marked as weak which changes the order to
character, language, family. This is what is desired in
matchFamilyStyleCharacter.
Review URL: https://codereview.chromium.org/1118553002
diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp
index 485e0fc..58597d9 100644
--- a/src/ports/SkFontMgr_fontconfig.cpp
+++ b/src/ports/SkFontMgr_fontconfig.cpp
@@ -771,7 +771,10 @@
FCLocker lock;
SkAutoFcPattern pattern;
- FcPatternAddString(pattern, FC_FAMILY, (FcChar8*)familyName);
+ FcValue familyNameValue;
+ familyNameValue.type = FcTypeString;
+ familyNameValue.u.s = reinterpret_cast<const FcChar8*>(familyName);
+ FcPatternAddWeak(pattern, FC_FAMILY, familyNameValue, FcFalse);
fcpattern_from_skfontstyle(style, pattern);
SkAutoFcCharSet charSet;