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

Side by Side Diff: src/pdf/SkPDFDocument.cpp

Issue 2231483002: SkPDF: Subset Type3 (fallback) font (Closed) Base URL: https://skia.googlesource.com/skia.git@SkPDF_next3
Patch Set: 2016-08-12 (Friday) 10:20:16 EDT 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 unified diff | Download patch
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | src/pdf/SkPDFFont.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkPDFCanon.h" 8 #include "SkPDFCanon.h"
9 #include "SkPDFCanvas.h" 9 #include "SkPDFCanvas.h"
10 #include "SkPDFDevice.h" 10 #include "SkPDFDevice.h"
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 SkASSERT(!fPages.empty()); 476 SkASSERT(!fPages.empty());
477 docCatalog->insertObjRef("Pages", generate_page_tree(&fPages)); 477 docCatalog->insertObjRef("Pages", generate_page_tree(&fPages));
478 SkASSERT(fPages.empty()); 478 SkASSERT(fPages.empty());
479 479
480 if (fDests->size() > 0) { 480 if (fDests->size() > 0) {
481 docCatalog->insertObjRef("Dests", std::move(fDests)); 481 docCatalog->insertObjRef("Dests", std::move(fDests));
482 } 482 }
483 483
484 // Build font subsetting info before calling addObjectRecursively(). 484 // Build font subsetting info before calling addObjectRecursively().
485 for (const auto& entry : fGlyphUsage) { 485 for (const auto& entry : fGlyphUsage) {
486 sk_sp<SkPDFFont> subsetFont( 486 sk_sp<SkPDFObject> subsetFont =
487 entry.fFont->getFontSubset(&entry.fGlyphSet)); 487 entry.fFont->getFontSubset(&entry.fGlyphSet);
488 if (subsetFont) { 488 if (subsetFont) {
489 fObjectSerializer.fSubstituteMap.setSubstitute( 489 fObjectSerializer.fSubstituteMap.setSubstitute(
490 entry.fFont, subsetFont.get()); 490 entry.fFont, subsetFont.get());
491 } 491 }
492 } 492 }
493 493
494 fObjectSerializer.addObjectRecursively(docCatalog); 494 fObjectSerializer.addObjectRecursively(docCatalog);
495 fObjectSerializer.serializeObjects(this->getStream()); 495 fObjectSerializer.serializeObjects(this->getStream());
496 fObjectSerializer.serializeFooter(this->getStream(), docCatalog, fID); 496 fObjectSerializer.serializeFooter(this->getStream(), docCatalog, fID);
497 fCanon.reset(); 497 fCanon.reset();
(...skipping 26 matching lines...) Expand all
524 } 524 }
525 525
526 sk_sp<SkDocument> SkDocument::MakePDF(SkWStream* stream, 526 sk_sp<SkDocument> SkDocument::MakePDF(SkWStream* stream,
527 SkScalar dpi, 527 SkScalar dpi,
528 const SkDocument::PDFMetadata& metadata, 528 const SkDocument::PDFMetadata& metadata,
529 sk_sp<SkPixelSerializer> jpegEncoder, 529 sk_sp<SkPixelSerializer> jpegEncoder,
530 bool pdfa) { 530 bool pdfa) {
531 return SkPDFMakeDocument(stream, nullptr, dpi, metadata, 531 return SkPDFMakeDocument(stream, nullptr, dpi, metadata,
532 std::move(jpegEncoder), pdfa); 532 std::move(jpegEncoder), pdfa);
533 } 533 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | src/pdf/SkPDFFont.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698