[PDF] Fix font embedding restrictions.

Stop using restricted font outlines and honor don't subset restriction.

Resubmit of r12600.

R=halcanary@google.com, bungeman@google.com, reed@google.com

Author: vandebo@chromium.org

Review URL: https://codereview.chromium.org/334443002
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index 26d30d7..e00b87b 100755
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -1544,17 +1544,16 @@
         CFStringToSkString(fontName, &info->fFontName);
     }
 
-    info->fMultiMaster = false;
     CFIndex glyphCount = CTFontGetGlyphCount(ctFont);
     info->fLastGlyphID = SkToU16(glyphCount - 1);
     info->fEmSize = CTFontGetUnitsPerEm(ctFont);
+    info->fFlags = SkAdvancedTypefaceMetrics::kEmpty_FontFlag;
+    info->fStyle = 0;
 
     if (perGlyphInfo & SkAdvancedTypefaceMetrics::kToUnicode_PerGlyphInfo) {
         populate_glyph_to_unicode(ctFont, glyphCount, &info->fGlyphToUnicode);
     }
 
-    info->fStyle = 0;
-
     // If it's not a truetype font, mark it as 'other'. Assume that TrueType
     // fonts always have both glyf and loca tables. At the least, this is what
     // sfntly needs to subset the font. CTFontCopyAttribute() does not always
@@ -1618,10 +1617,7 @@
         }
     }
 
-    if (false) { // TODO: haven't figured out how to know if font is embeddable
-        // (information is in the OS/2 table)
-        info->fType = SkAdvancedTypefaceMetrics::kNotEmbeddable_Font;
-    } else if (perGlyphInfo & SkAdvancedTypefaceMetrics::kHAdvance_PerGlyphInfo) {
+    if (perGlyphInfo & SkAdvancedTypefaceMetrics::kHAdvance_PerGlyphInfo) {
         if (info->fStyle & SkAdvancedTypefaceMetrics::kFixedPitch_Style) {
             skia_advanced_typeface_metrics_utils::appendRange(&info->fGlyphWidths, 0);
             info->fGlyphWidths->fAdvance.append(1, &min_width);