[PDF] Fix font embedding restrictions.

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

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

Author: vandebo@chromium.org

Review URL: https://codereview.chromium.org/107863002

git-svn-id: http://skia.googlecode.com/svn/trunk/include@12600 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/core/SkAdvancedTypefaceMetrics.h b/core/SkAdvancedTypefaceMetrics.h
index e75365b..1192688 100755
--- a/core/SkAdvancedTypefaceMetrics.h
+++ b/core/SkAdvancedTypefaceMetrics.h
@@ -35,15 +35,21 @@
         kCFF_Font,
         kTrueType_Font,
         kOther_Font,
-        kNotEmbeddable_Font
     };
     // The type of the underlying font program.  This field determines which
-    // of the following fields are valid.  If it is kOther_Font or
-    // kNotEmbeddable_Font, the per glyph information will never be populated.
+    // of the following fields are valid.  If it is kOther_Font the per glyph
+    // information will never be populated.
     FontType fType;
 
-    // fMultiMaster may be true for Type1_Font or CFF_Font.
-    bool fMultiMaster;
+    enum FontFlags {
+        kEmpty_FontFlag          = 0x0,  //!<No flags set
+        kMultiMaster_FontFlag    = 0x1,  //!<May be true for Type1 or CFF fonts.
+        kNotEmbeddable_FontFlag  = 0x2,  //!<May not be embedded.
+        kNotSubsettable_FontFlag = 0x4,  //!<May not be subset.
+    };
+    // Global font flags.
+    FontFlags fFlags;
+
     uint16_t fLastGlyphID; // The last valid glyph ID in the font.
     uint16_t fEmSize;  // The size of the em box (defines font units).
 
diff --git a/pdf/SkPDFDocument.h b/pdf/SkPDFDocument.h
index 9f651fd..07738a2 100644
--- a/pdf/SkPDFDocument.h
+++ b/pdf/SkPDFDocument.h
@@ -69,9 +69,17 @@
     SK_API bool appendPage(SkPDFDevice* pdfDevice);
 
     /** Get the count of unique font types used in the document.
+     * DEPRECATED.
      */
     SK_API void getCountOfFontTypes(
-        int counts[SkAdvancedTypefaceMetrics::kNotEmbeddable_Font + 1]) const;
+        int counts[SkAdvancedTypefaceMetrics::kOther_Font + 2]) const;
+
+    /** Get the count of unique font types used in the document.
+     */
+    SK_API void getCountOfFontTypes(
+        int counts[SkAdvancedTypefaceMetrics::kOther_Font + 1],
+        int* notSubsettableCount,
+        int* notEmbedddableCount) const;
 
 private:
     SkAutoTDelete<SkPDFCatalog> fCatalog;