Index: src/ports/SkFontConfigInterface_android.cpp |
diff --git a/src/ports/SkFontConfigInterface_android.cpp b/src/ports/SkFontConfigInterface_android.cpp |
index 9a38261e80262789788e545dd9d86cbb5d1d9825..dbebd330574391a232a5cfa3e33e3dccc2ac3d90 100644 |
--- a/src/ports/SkFontConfigInterface_android.cpp |
+++ b/src/ports/SkFontConfigInterface_android.cpp |
@@ -95,7 +95,7 @@ public: |
* Get the family name of the font in the default fallback font list that |
* contains the specified chararacter. if no font is found, returns false. |
*/ |
- bool getFallbackFamilyNameForChar(SkUnichar uni, SkString* name); |
+ bool getFallbackFamilyNameForChar(SkUnichar uni, const SkString& lang, SkString* name); |
/** |
* |
*/ |
@@ -246,10 +246,10 @@ SkFontConfigInterfaceAndroid::SkFontConfigInterfaceAndroid(SkTDArray<FontFamily* |
if (fontRec.fIsValid) { |
DEBUG_FONT(("---- SystemFonts[%d][%d] fallback=%d file=%s", |
- i, fFonts.count() - 1, fontRec.fIsFallbackFont, filename.c_str())); |
+ i, fFonts.count() - 1, family->fIsFallbackFont, filename.c_str())); |
} else { |
DEBUG_FONT(("---- SystemFonts[%d][%d] fallback=%d file=%s (INVALID)", |
- i, fFonts.count() - 1, fontRec.fIsFallbackFont, filename.c_str())); |
+ i, fFonts.count() - 1, family->fIsFallbackFont, filename.c_str())); |
continue; |
} |
@@ -504,8 +504,10 @@ SkTypeface* SkFontConfigInterfaceAndroid::getTypefaceForFontRec(FontRecID fontRe |
return face; |
} |
-bool SkFontConfigInterfaceAndroid::getFallbackFamilyNameForChar(SkUnichar uni, SkString* name) { |
- FallbackFontList* fallbackFontList = this->getCurrentLocaleFallbackFontList(); |
+bool SkFontConfigInterfaceAndroid::getFallbackFamilyNameForChar(SkUnichar uni, |
+ const SkString& lang, |
+ SkString* name) { |
+ FallbackFontList* fallbackFontList = this->findFallbackFontList(lang); |
for (int i = 0; i < fallbackFontList->count(); i++) { |
FamilyRecID familyRecID = fallbackFontList->getAt(i); |
FontRecID fontRecID = find_best_style(fFontFamilies[familyRecID], SkTypeface::kNormal); |
@@ -662,8 +664,14 @@ SkTypeface* SkFontConfigInterfaceAndroid::nextLogicalTypeface(SkFontID currFontI |
/////////////////////////////////////////////////////////////////////////////// |
bool SkGetFallbackFamilyNameForChar(SkUnichar uni, SkString* name) { |
+ SkString locale = SkFontConfigParser::GetLocale(); |
+ SkFontConfigInterfaceAndroid* fontConfig = getSingletonInterface(); |
+ return fontConfig->getFallbackFamilyNameForChar(uni, locale, name); |
+} |
+ |
+bool SkGetFallbackFamilyNameForChar(SkUnichar uni, const SkString& lang, SkString* name) { |
SkFontConfigInterfaceAndroid* fontConfig = getSingletonInterface(); |
- return fontConfig->getFallbackFamilyNameForChar(uni, name); |
+ return fontConfig->getFallbackFamilyNameForChar(uni, lang, name); |
} |
void SkUseTestFontConfigFile(const char* mainconf, const char* fallbackconf, |