aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-08-24 09:55:56 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-24 09:55:56 -0700
commit6321381d18f9d478598c0996c1380633003961dd (patch)
tree9e6b87fecabe31d81da45d9c60086b3dfb238767 /src/pdf
parentef4f32ac858825dc443cfe4739ea878fb0bf550f (diff)
GN: more optional components: jpeg, pdf, png, xml
Diffstat (limited to 'src/pdf')
-rw-r--r--src/pdf/SkPDFFont.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp
index 887f95001f..a05462c4fb 100644
--- a/src/pdf/SkPDFFont.cpp
+++ b/src/pdf/SkPDFFont.cpp
@@ -142,9 +142,11 @@ static bool can_embed(const SkAdvancedTypefaceMetrics& metrics) {
return !SkToBool(metrics.fFlags & SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag);
}
+#ifdef SK_SFNTLY_SUBSETTER
static bool can_subset(const SkAdvancedTypefaceMetrics& metrics) {
return !SkToBool(metrics.fFlags & SkAdvancedTypefaceMetrics::kNotSubsettable_FontFlag);
}
+#endif
int SkPDFFont::glyphsToPDFFontEncoding(SkGlyphID* glyphIDs, int numGlyphs) const {
// A font with multibyte glyphs will support all glyph IDs in a single font.
@@ -415,7 +417,7 @@ void SkPDFType0Font::getFontSubset(SkPDFCanon* canon) {
return;
}
- #ifdef SK_SFNTLY_SUBSETTER
+ #ifdef SK_SFNTLY_SUBSETTER
if (can_subset(metrics)) {
// Generate glyph id array. in format needed by sfntly
SkTDArray<uint32_t> glyphIDs;
@@ -432,7 +434,7 @@ void SkPDFType0Font::getFontSubset(SkPDFCanon* canon) {
// If subsetting fails, fall back to original font data.
fontAsset.reset(face->openStream(&ttcIndex));
}
- #endif // SK_SFNTLY_SUBSETTER
+ #endif // SK_SFNTLY_SUBSETTER
auto fontStream = sk_make_sp<SkPDFSharedStream>(std::move(fontAsset));
fontStream->dict()->insertInt("Length1", fontSize);
descriptor->insertObjRef("FontFile2", std::move(fontStream));