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

Unified Diff: src/ports/SkFontConfigParser_android.cpp

Issue 468893002: Mark fallback fonts in new Android font config parser (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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 | « no previous file | tests/FontConfigParser.cpp » ('j') | 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 6e8727048d4706412e96af4ddd3e9803fc18bda5..e9c912f4b012e0e9608eab2cf5d7713d6cc48d49 100644
--- a/src/ports/SkFontConfigParser_android.cpp
+++ b/src/ports/SkFontConfigParser_android.cpp
@@ -91,7 +91,9 @@ namespace lmpParser {
void familyElementHandler(FontFamily* family, const char** attributes) {
// A non-fallback <family> tag must have a canonical name attribute.
- // A (fallback) <family> tag may have lang and variant attributes.
+ // A fallback <family> tag has no name, and may have lang and variant
+ // attributes.
+ family->fIsFallbackFont = true;
for (size_t i = 0; attributes[i] != NULL &&
attributes[i+1] != NULL; i += 2) {
const char* name = attributes[i];
@@ -101,6 +103,7 @@ void familyElementHandler(FontFamily* family, const char** attributes) {
if (nameLen == 4 && !strncmp("name", name, nameLen)) {
SkAutoAsciiToLC tolc(value);
family->fNames.push_back().set(tolc.lc());
+ family->fIsFallbackFont = false;
} else if (nameLen == 4 && !strncmp("lang", name, nameLen)) {
family->fLanguage = SkLanguage (value);
} else if (nameLen == 7 && !strncmp("variant", name, nameLen)) {
« no previous file with comments | « no previous file | tests/FontConfigParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698