Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: src/pdf/SkPDFFont.cpp

Issue 2267343004: GN: more optional components: jpeg, pdf, png, xml (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Do not include png.h from SkPngCodec.h Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/codec/SkPngCodec.h ('K') | « src/codec/SkPngCodec.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFFont.cpp
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp
index 887f95001f406e88f6f4d4d2e3b942d51081f7bd..a05462c4fb3fd395f9fb929896d3fc5f7eb322c5 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));
« src/codec/SkPngCodec.h ('K') | « src/codec/SkPngCodec.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698