Index: src/pdf/SkPDFDocument.cpp |
diff --git a/src/pdf/SkPDFDocument.cpp b/src/pdf/SkPDFDocument.cpp |
index 4a577fcff34ac1632541c72fca7d1734f1a2dcd1..4f044c87717c90c8c77aced56f2d9f79bd94ba29 100644 |
--- a/src/pdf/SkPDFDocument.cpp |
+++ b/src/pdf/SkPDFDocument.cpp |
@@ -168,46 +168,6 @@ static sk_sp<SkPDFDict> generate_page_tree(SkTArray<sk_sp<SkPDFDict>>* pages) { |
return std::move(curNodes[0]); |
} |
-#if 0 |
-// TODO(halcanary): expose notEmbeddableCount in SkDocument |
-void GetCountOfFontTypes( |
- const SkTDArray<SkPDFDevice*>& pageDevices, |
- int counts[SkAdvancedTypefaceMetrics::kOther_Font + 1], |
- int* notSubsettableCount, |
- int* notEmbeddableCount) { |
- sk_bzero(counts, sizeof(int) * |
- (SkAdvancedTypefaceMetrics::kOther_Font + 1)); |
- SkTDArray<SkFontID> seenFonts; |
- int notSubsettable = 0; |
- int notEmbeddable = 0; |
- |
- for (int pageNumber = 0; pageNumber < pageDevices.count(); pageNumber++) { |
- const SkTDArray<SkPDFFont*>& fontResources = |
- pageDevices[pageNumber]->getFontResources(); |
- for (int font = 0; font < fontResources.count(); font++) { |
- SkFontID fontID = fontResources[font]->typeface()->uniqueID(); |
- if (seenFonts.find(fontID) == -1) { |
- counts[fontResources[font]->getType()]++; |
- seenFonts.push(fontID); |
- if (!fontResources[font]->canSubset()) { |
- notSubsettable++; |
- } |
- if (!fontResources[font]->canEmbed()) { |
- notEmbeddable++; |
- } |
- } |
- } |
- } |
- if (notSubsettableCount) { |
- *notSubsettableCount = notSubsettable; |
- |
- } |
- if (notEmbeddableCount) { |
- *notEmbeddableCount = notEmbeddable; |
- } |
-} |
-#endif |
- |
template <typename T> static T* clone(const T* o) { return o ? new T(*o) : nullptr; } |
//////////////////////////////////////////////////////////////////////////////// |
@@ -484,7 +444,7 @@ bool SkPDFDocument::onClose(SkWStream* stream) { |
// Build font subsetting info before calling addObjectRecursively(). |
for (const auto& entry : fGlyphUsage) { |
sk_sp<SkPDFObject> subsetFont = |
- entry.fFont->getFontSubset(&entry.fGlyphSet); |
+ entry.fFont->getFontSubset(&fCanon, &entry.fGlyphSet); |
if (subsetFont) { |
fObjectSerializer.fSubstituteMap.setSubstitute( |
entry.fFont, subsetFont.get()); |