aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2015-04-29 11:32:57 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-29 11:32:57 -0700
commit1d4ec0a1ad4998c32c6a28ff4b85000553ff686d (patch)
treeaf414df0ccdc246f5ecce5f07a57f63b2598d934 /src/ports
parentfa2008ff6ee5963fc2566b20c1af39367b77bdf7 (diff)
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
Diffstat (limited to 'src/ports')
-rw-r--r--src/ports/SkFontMgr_fontconfig.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp
index 485e0fc6cc..58597d9395 100644
--- a/src/ports/SkFontMgr_fontconfig.cpp
+++ b/src/ports/SkFontMgr_fontconfig.cpp
@@ -771,7 +771,10 @@ protected:
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;