Index: src/ports/SkFontMgr_fontconfig.cpp |
diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp |
index 089be5cdbe16eeeeeddc390ab9380609a2a53fb4..0292905fe37e8da1d5e0fb240aeef8c9abe0abe8 100644 |
--- a/src/ports/SkFontMgr_fontconfig.cpp |
+++ b/src/ports/SkFontMgr_fontconfig.cpp |
@@ -882,15 +882,12 @@ protected: |
return new SkTypeface_stream(fontData, style, isFixedWidth); |
} |
- virtual SkTypeface* onLegacyCreateTypeface(const char familyName[], |
- unsigned styleBits) const override { |
- bool bold = styleBits & SkTypeface::kBold; |
- bool italic = styleBits & SkTypeface::kItalic; |
- SkFontStyle style = SkFontStyle(bold ? SkFontStyle::kBold_Weight |
- : SkFontStyle::kNormal_Weight, |
- SkFontStyle::kNormal_Width, |
- italic ? SkFontStyle::kItalic_Slant |
- : SkFontStyle::kUpright_Slant); |
+#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE |
+ SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBits) const override { |
+ SkFontStyle style = SkFontStyle::FromOldStyle(styleBits); |
+#else |
+ SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle style) const override { |
+#endif |
SkAutoTUnref<SkTypeface> typeface(this->matchFamilyStyle(familyName, style)); |
if (typeface.get()) { |
return typeface.release(); |