Index: src/fonts/SkFontMgr_indirect.cpp |
diff --git a/src/fonts/SkFontMgr_indirect.cpp b/src/fonts/SkFontMgr_indirect.cpp |
index fc0bd5c7ce8b16af764840da6cc5943937e7acbb..4d226da855f9296100ffee0ef6edc549c98ab5f1 100644 |
--- a/src/fonts/SkFontMgr_indirect.cpp |
+++ b/src/fonts/SkFontMgr_indirect.cpp |
@@ -184,16 +184,14 @@ SkTypeface* SkFontMgr_Indirect::onCreateFromData(SkData* data, int ttcIndex) con |
return fImpl->createFromData(data, ttcIndex); |
} |
+#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE |
SkTypeface* SkFontMgr_Indirect::onLegacyCreateTypeface(const char familyName[], |
unsigned styleBits) const { |
- bool bold = SkToBool(styleBits & SkTypeface::kBold); |
- bool italic = SkToBool(styleBits & SkTypeface::kItalic); |
- SkFontStyle style = SkFontStyle(bold ? SkFontStyle::kBold_Weight |
- : SkFontStyle::kNormal_Weight, |
- SkFontStyle::kNormal_Width, |
- italic ? SkFontStyle::kItalic_Slant |
- : SkFontStyle::kUpright_Slant); |
- |
+ SkFontStyle style = SkFontStyle::FromOldStyle(styleBits); |
+#else |
+SkTypeface* SkFontMgr_Indirect::onLegacyCreateTypeface(const char familyName[], |
+ SkFontStyle style) const { |
+#endif |
SkAutoTUnref<SkTypeface> face(this->matchFamilyStyle(familyName, style)); |
if (nullptr == face.get()) { |