Index: src/ports/SkFontMgr_android.cpp |
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp |
index d7db09bde2af5fe0a9d1819f3f2c0f595fd3f6dc..61f990c7387241a1475388ba1cd660a4be4e636a 100644 |
--- a/src/ports/SkFontMgr_android.cpp |
+++ b/src/ports/SkFontMgr_android.cpp |
@@ -143,15 +143,9 @@ |
continue; |
} |
- int weight = fontFile.fWeight != 0 ? fontFile.fWeight : style.weight(); |
- SkFontStyle::Slant 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); |
+ if (fontFile.fWeight != 0) { |
+ style = SkFontStyle(fontFile.fWeight, style.width(), style.slant()); |
+ } |
const SkLanguage& lang = family.fLanguage; |
uint32_t variant = family.fVariant; |