Index: src/ports/SkFontMgr_fontconfig.cpp |
diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp |
index dbc64b6e47655749ab8bf2919e708f01b10eacf3..6ec5604af4fbae11b4626d172499cab30b08a890 100644 |
--- a/src/ports/SkFontMgr_fontconfig.cpp |
+++ b/src/ports/SkFontMgr_fontconfig.cpp |
@@ -762,11 +762,22 @@ protected: |
return createTypefaceFromFcPattern(font); |
} |
+#ifdef SK_FM_NEW_MATCH_FAMILY_STYLE_CHARACTER |
virtual SkTypeface* onMatchFamilyStyleCharacter(const char familyName[], |
const SkFontStyle& style, |
- const char bpc47[], |
- uint32_t character) const SK_OVERRIDE |
+ const char* bcp47[], |
+ int bcp47Count, |
+ SkUnichar character) const SK_OVERRIDE |
{ |
+#else |
+ virtual SkTypeface* onMatchFamilyStyleCharacter(const char familyName[], |
+ const SkFontStyle& style, |
+ const char bcp47_val[], |
+ SkUnichar character) const SK_OVERRIDE |
+ { |
+ const char** bcp47 = &bcp47_val; |
+ int bcp47Count = bcp47_val ? 1 : 0; |
+#endif |
FCLocker lock; |
SkAutoFcPattern pattern; |
@@ -777,9 +788,12 @@ protected: |
FcCharSetAddChar(charSet, character); |
FcPatternAddCharSet(pattern, FC_CHARSET, charSet); |
- if (bpc47) { |
+ if (bcp47Count > 0) { |
+ SkASSERT(bcp47); |
SkAutoFcLangSet langSet; |
- FcLangSetAdd(langSet, (const FcChar8*)bpc47); |
+ for (int i = bcp47Count; i --> 0;) { |
+ FcLangSetAdd(langSet, (const FcChar8*)bcp47[i]); |
+ } |
FcPatternAddLangSet(pattern, FC_LANG, langSet); |
} |