diff --git a/include/core/SkAdvancedTypefaceMetrics.h b/include/core/SkAdvancedTypefaceMetrics.h index d326379a50..acfd86e218 100755 --- a/include/core/SkAdvancedTypefaceMetrics.h +++ b/include/core/SkAdvancedTypefaceMetrics.h @@ -52,9 +52,7 @@ public: enum StyleFlags { kFixedPitch_Style = 0x00001, kSerif_Style = 0x00002, - kSymbolic_Style = 0x00004, kScript_Style = 0x00008, - kNonsymbolic_Style = 0x00020, kItalic_Style = 0x00040, kAllCaps_Style = 0x10000, kSmallCaps_Style = 0x20000, diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp index a38510ceb0..10252ad52a 100644 --- a/src/pdf/SkPDFFont.cpp +++ b/src/pdf/SkPDFFont.cpp @@ -31,6 +31,11 @@ #include SK_SFNTLY_SUBSETTER #endif +// PDF's notion of symbolic vs non-symbolic is related to the character set, not +// symbols vs. characters. Rarely is a font the right character set to call it +// non-symbolic, so always call it symbolic. (PDF 1.4 spec, section 5.7.1) +static const int kPdfSymbolic = 4; + namespace { /////////////////////////////////////////////////////////////////////////////// @@ -945,7 +950,7 @@ bool SkPDFFont::addCommonFontDescriptorEntries(int16_t defaultWidth) { const uint16_t emSize = fFontInfo->fEmSize; fDescriptor->insertName("FontName", fFontInfo->fFontName); - fDescriptor->insertInt("Flags", fFontInfo->fStyle); + fDescriptor->insertInt("Flags", fFontInfo->fStyle | kPdfSymbolic); fDescriptor->insertScalar("Ascent", scaleFromFontUnits(fFontInfo->fAscent, emSize)); fDescriptor->insertScalar("Descent", diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp index 9422cf99d3..40d939c17c 100644 --- a/src/ports/SkFontHost_FreeType.cpp +++ b/src/ports/SkFontHost_FreeType.cpp @@ -499,9 +499,6 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics( info->fStyle |= SkAdvancedTypefaceMetrics::kFixedPitch_Style; if (face->style_flags & FT_STYLE_FLAG_ITALIC) info->fStyle |= SkAdvancedTypefaceMetrics::kItalic_Style; - // We should set either Symbolic or Nonsymbolic; Nonsymbolic if the font's - // character set is a subset of 'Adobe standard Latin.' - info->fStyle |= SkAdvancedTypefaceMetrics::kSymbolic_Style; PS_FontInfoRec ps_info; TT_Postscript* tt_info; diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp index 83c811a684..4a6b8d8b68 100755 --- a/src/ports/SkFontHost_mac.cpp +++ b/src/ports/SkFontHost_mac.cpp @@ -1520,9 +1520,6 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics( info->fStyle |= SkAdvancedTypefaceMetrics::kItalic_Style; } CTFontStylisticClass stylisticClass = symbolicTraits & kCTFontClassMaskTrait; - if (stylisticClass & kCTFontSymbolicClass) { - info->fStyle |= SkAdvancedTypefaceMetrics::kSymbolic_Style; - } if (stylisticClass >= kCTFontOldStyleSerifsClass && stylisticClass <= kCTFontSlabSerifsClass) { info->fStyle |= SkAdvancedTypefaceMetrics::kSerif_Style; } else if (stylisticClass & kCTFontScriptsClass) { diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp index 0f7295f5a0..d0fbd47e2d 100755 --- a/src/ports/SkFontHost_win.cpp +++ b/src/ports/SkFontHost_win.cpp @@ -1406,8 +1406,6 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics( if (otm.otmTextMetrics.tmItalic) { info->fStyle |= SkAdvancedTypefaceMetrics::kItalic_Style; } - // Setting symbolic style by default for now. - info->fStyle |= SkAdvancedTypefaceMetrics::kSymbolic_Style; if (otm.otmTextMetrics.tmPitchAndFamily & FF_ROMAN) { info->fStyle |= SkAdvancedTypefaceMetrics::kSerif_Style; } else if (otm.otmTextMetrics.tmPitchAndFamily & FF_SCRIPT) { diff --git a/src/ports/SkFontHost_win_dw.cpp b/src/ports/SkFontHost_win_dw.cpp index 1f257eb3d1..4bf91511c1 100644 --- a/src/ports/SkFontHost_win_dw.cpp +++ b/src/ports/SkFontHost_win_dw.cpp @@ -1488,8 +1488,6 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics( if (os2Table->version.v0.fsSelection.field.Italic) { info->fStyle |= SkAdvancedTypefaceMetrics::kItalic_Style; } - //Symbolic (uses more than base latin). - info->fStyle |= SkAdvancedTypefaceMetrics::kSymbolic_Style; //Script if (SkPanose::FamilyType::Script == os2Table->version.v0.panose.bFamilyType.value) { info->fStyle |= SkAdvancedTypefaceMetrics::kScript_Style;