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

Unified Diff: src/ports/SkFontConfigParser_android.cpp

Issue 17691002: Ensure we use the current locale when looking up fallback fonts per character (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remove mutex Created 7 years, 6 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 | « src/ports/SkFontConfigParser_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/SkFontConfigParser_android.cpp
diff --git a/src/ports/SkFontConfigParser_android.cpp b/src/ports/SkFontConfigParser_android.cpp
index 9214d1bf61484e8addc8198ca4753d840c61c234..b1c815993a82510f52e49013236bef7ba70f29ec 100644
--- a/src/ports/SkFontConfigParser_android.cpp
+++ b/src/ports/SkFontConfigParser_android.cpp
@@ -254,7 +254,7 @@ void SkFontConfigParser::GetTestFontFamilies(SkTDArray<FontFamily*> &fontFamilie
/**
* Read the persistent locale.
*/
-void SkFontConfigParser::GetLocale(AndroidLocale &locale)
+SkString SkFontConfigParser::GetLocale()
{
char propLang[PROP_VALUE_MAX], propRegn[PROP_VALUE_MAX];
__system_property_get("persist.sys.language", propLang);
@@ -269,8 +269,14 @@ void SkFontConfigParser::GetLocale(AndroidLocale &locale)
strcpy(propRegn, "US");
}
}
- strncpy(locale.language, propLang, 2);
- locale.language[2] = '\0';
- strncpy(locale.region, propRegn, 2);
- locale.region[2] = '\0';
+
+ SkString locale(6);
+ char* localeCStr = locale.writable_str();
+
+ strncpy(localeCStr, propLang, 2);
+ localeCStr[2] = '-';
+ strncpy(&localeCStr[3], propRegn, 2);
+ localeCStr[5] = '\0';
+
+ return locale;
}
« no previous file with comments | « src/ports/SkFontConfigParser_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698