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

Unified Diff: src/ports/SkFontConfigParser_android.cpp

Issue 1092093002: Respect declared font style on Android. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Explicitly default the style to Auto. Created 5 years, 8 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
Index: src/ports/SkFontConfigParser_android.cpp
diff --git a/src/ports/SkFontConfigParser_android.cpp b/src/ports/SkFontConfigParser_android.cpp
index ffc60427f47a0d841288f8c9ff997e057f793385..5ea4fd42c04ddbcba7024085e2c6120454e3ca18 100644
--- a/src/ports/SkFontConfigParser_android.cpp
+++ b/src/ports/SkFontConfigParser_android.cpp
@@ -159,6 +159,13 @@ static void font_element_handler(FamilyData* self, FontFileInfo* file, const cha
if (!parse_non_negative_integer(value, &file->fWeight)) {
SkDebugf("---- Font weight %s (INVALID)", value);
}
+ } else if (MEMEQ("style", name, nameLen)) {
+ size_t valueLen = strlen(value);
+ if (MEMEQ("normal", value, valueLen)) {
+ file->fStyle = FontFileInfo::Style::Normal;
+ } else if (MEMEQ("italic", value, valueLen)) {
+ file->fStyle = FontFileInfo::Style::Italic;
+ }
} else if (MEMEQ("index", name, nameLen)) {
if (!parse_non_negative_integer(value, &file->fIndex)) {
SkDebugf("---- Font index %s (INVALID)", value);

Powered by Google App Engine
This is Rietveld 408576698