Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(799)

Unified Diff: src/ports/SkFontConfigInterface_android.cpp

Issue 26325003: Fix ambiguity in API if no matching system language is found (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/ports/SkTypeface_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontConfigInterface_android.cpp
diff --git a/src/ports/SkFontConfigInterface_android.cpp b/src/ports/SkFontConfigInterface_android.cpp
index 9c188d90c63efa803810fc7b30d7bce1c06df49a..6f9ed3a93b46bbf1987c7265cd2fbeb6d4bd2177 100644
--- a/src/ports/SkFontConfigInterface_android.cpp
+++ b/src/ports/SkFontConfigInterface_android.cpp
@@ -513,7 +513,14 @@ SkTypeface* SkFontConfigInterfaceAndroid::getTypefaceForFontRec(FontRecID fontRe
bool SkFontConfigInterfaceAndroid::getFallbackFamilyNameForChar(SkUnichar uni,
const char* lang,
SkString* name) {
- FallbackFontList* fallbackFontList = this->findFallbackFontList(lang);
+ FallbackFontList* fallbackFontList = NULL;
+ const SkString langTag(lang);
+ if (langTag.isEmpty()) {
+ fallbackFontList = this->getCurrentLocaleFallbackFontList();
+ } else {
+ fallbackFontList = this->findFallbackFontList(langTag);
+ }
+
for (int i = 0; i < fallbackFontList->count(); i++) {
FamilyRecID familyRecID = fallbackFontList->getAt(i);
@@ -733,9 +740,8 @@ SkTypeface* SkFontConfigInterfaceAndroid::getTypefaceForGlyphID(uint16_t glyphID
///////////////////////////////////////////////////////////////////////////////
bool SkGetFallbackFamilyNameForChar(SkUnichar uni, SkString* name) {
- SkString locale = SkFontConfigParser::GetLocale();
SkFontConfigInterfaceAndroid* fontConfig = getSingletonInterface();
- return fontConfig->getFallbackFamilyNameForChar(uni, locale.c_str(), name);
+ return fontConfig->getFallbackFamilyNameForChar(uni, NULL, name);
}
bool SkGetFallbackFamilyNameForChar(SkUnichar uni, const char* lang, SkString* name) {
« no previous file with comments | « include/ports/SkTypeface_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698