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,
#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 {
///////////////////////////////////////////////////////////////////////////////
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",
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;
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) {
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) {
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;