Index: src/fonts/SkFontMgr_fontconfig.cpp |
diff --git a/src/fonts/SkFontMgr_fontconfig.cpp b/src/fonts/SkFontMgr_fontconfig.cpp |
index 50af9b4c4017902dca1c9a030de9efe9e4ede7b1..60ad862a507de828d17c5ba0e9d98fd78515ad48 100644 |
--- a/src/fonts/SkFontMgr_fontconfig.cpp |
+++ b/src/fonts/SkFontMgr_fontconfig.cpp |
@@ -318,10 +318,14 @@ protected: |
return stream.get() ? this->createFromStream(stream.release(), ttcIndex) : nullptr; |
} |
- SkTypeface* onLegacyCreateTypeface(const char familyName[], |
- unsigned styleBits) const override { |
+#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE |
+ SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBits) const override { |
+ SkTypeface::Style style = static_cast<SkTypeface::Style>(styleBits); |
+#else |
+ SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle style) const override { |
+#endif |
FCLocker lock; |
- return FontConfigTypeface::LegacyCreateTypeface(familyName, (SkTypeface::Style)styleBits); |
+ return FontConfigTypeface::LegacyCreateTypeface(familyName, style); |
} |
}; |