Index: src/ports/SkFontMgr_android.cpp |
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp |
index 61f990c7387241a1475388ba1cd660a4be4e636a..ae1b663e261dd30a976fbed417e09d033c92bee7 100644 |
--- a/src/ports/SkFontMgr_android.cpp |
+++ b/src/ports/SkFontMgr_android.cpp |
@@ -143,9 +143,15 @@ public: |
continue; |
} |
- if (fontFile.fWeight != 0) { |
- style = SkFontStyle(fontFile.fWeight, style.width(), style.slant()); |
+ int weight = fontFile.fWeight != 0 ? fontFile.fWeight : style.weight(); |
+ SkFontStyle::Slant slant = style.slant(); |
+ switch (fontFile.fStyle) { |
+ case FontFileInfo::Style::kAuto: slant = style.slant(); break; |
+ case FontFileInfo::Style::kNormal: slant = SkFontStyle::kUpright_Slant; break; |
+ case FontFileInfo::Style::kItalic: slant = SkFontStyle::kItalic_Slant; break; |
+ default: SkASSERT(false); break; |
} |
+ style = SkFontStyle(weight, style.width(), slant); |
const SkLanguage& lang = family.fLanguage; |
uint32_t variant = family.fVariant; |