Index: src/ports/SkTypeface_win_dw.cpp |
diff --git a/src/ports/SkTypeface_win_dw.cpp b/src/ports/SkTypeface_win_dw.cpp |
index 09eeb36405c9debc077db00e3e2682717ff549f3..348bc9f81e46002a42be807feec4a25bd1c51861 100644 |
--- a/src/ports/SkTypeface_win_dw.cpp |
+++ b/src/ports/SkTypeface_win_dw.cpp |
@@ -383,14 +383,25 @@ SkAdvancedTypefaceMetrics* DWriteFontTypeface::onGetAdvancedTypefaceMetrics( |
if (os2Table->version.v0.fsSelection.field.Italic) { |
info->fStyle |= SkAdvancedTypefaceMetrics::kItalic_Style; |
} |
+ //Serif |
+ using SerifStyle = SkPanose::Data::TextAndDisplay::SerifStyle; |
+ SerifStyle serifStyle = os2Table->version.v0.panose.data.textAndDisplay.bSerifStyle; |
+ if (SkPanose::FamilyType::TextAndDisplay == os2Table->version.v0.panose.bFamilyType) { |
+ if (SerifStyle::Cove == serifStyle || |
+ SerifStyle::ObtuseCove == serifStyle || |
+ SerifStyle::SquareCove == serifStyle || |
+ SerifStyle::ObtuseSquareCove == serifStyle || |
+ SerifStyle::Square == serifStyle || |
+ SerifStyle::Thin == serifStyle || |
+ SerifStyle::Bone == serifStyle || |
+ SerifStyle::Exaggerated == serifStyle || |
+ SerifStyle::Triangle == serifStyle) |
+ { |
+ info->fStyle |= SkAdvancedTypefaceMetrics::kSerif_Style; |
+ } |
//Script |
- if (SkPanose::FamilyType::Script == os2Table->version.v0.panose.bFamilyType.value) { |
+ } else if (SkPanose::FamilyType::Script == os2Table->version.v0.panose.bFamilyType) { |
info->fStyle |= SkAdvancedTypefaceMetrics::kScript_Style; |
- //Serif |
- } else if (SkPanose::FamilyType::TextAndDisplay == os2Table->version.v0.panose.bFamilyType.value && |
- SkPanose::Data::TextAndDisplay::SerifStyle::Triangle <= os2Table->version.v0.panose.data.textAndDisplay.bSerifStyle.value && |
- SkPanose::Data::TextAndDisplay::SerifStyle::NoFit != os2Table->version.v0.panose.data.textAndDisplay.bSerifStyle.value) { |
- info->fStyle |= SkAdvancedTypefaceMetrics::kSerif_Style; |
} |
info->fItalicAngle = SkEndian_SwapBE32(postTable->italicAngle) >> 16; |