diff options
author | mtklein <mtklein@chromium.org> | 2016-08-24 09:55:56 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-24 09:55:56 -0700 |
commit | 6321381d18f9d478598c0996c1380633003961dd (patch) | |
tree | 9e6b87fecabe31d81da45d9c60086b3dfb238767 /src/pdf | |
parent | ef4f32ac858825dc443cfe4739ea878fb0bf550f (diff) |
GN: more optional components: jpeg, pdf, png, xml
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2267343004
Review-Url: https://codereview.chromium.org/2267343004
Diffstat (limited to 'src/pdf')
-rw-r--r-- | src/pdf/SkPDFFont.cpp | 6 |
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)); |