Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: src/ports/SkTypeface_win_dw.cpp

Issue 2253543004: Move FamilyClass and Panose enums to enum class. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Windows. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/sfnt/SkIBMFamilyClass.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | src/sfnt/SkIBMFamilyClass.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698