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

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

Issue 23654012: [PDF] Rewind the font stream if font subsetting fails. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 <ctype.h> 8 #include <ctype.h>
9 9
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 sk_delete_array, 575 sk_delete_array,
576 NULL)); 576 NULL));
577 subsetFontStream = new SkPDFStream(data.get()); 577 subsetFontStream = new SkPDFStream(data.get());
578 fontSize = subsetFontSize; 578 fontSize = subsetFontSize;
579 } 579 }
580 } 580 }
581 if (subsetFontStream) { 581 if (subsetFontStream) {
582 *fontStream = subsetFontStream; 582 *fontStream = subsetFontStream;
583 return fontSize; 583 return fontSize;
584 } 584 }
585 fontData->rewind();
585 #else 586 #else
586 sk_ignore_unused_variable(fontName); 587 sk_ignore_unused_variable(fontName);
587 sk_ignore_unused_variable(subset); 588 sk_ignore_unused_variable(subset);
588 #endif 589 #endif
589 590
590 // Fail over: just embed the whole font. 591 // Fail over: just embed the whole font.
591 *fontStream = new SkPDFStream(fontData.get()); 592 *fontStream = new SkPDFStream(fontData.get());
592 return fontSize; 593 return fontSize;
593 } 594 }
594 595
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 1409
1409 insert("FontBBox", makeFontBBox(bbox, 1000))->unref(); 1410 insert("FontBBox", makeFontBBox(bbox, 1000))->unref();
1410 insertInt("FirstChar", firstGlyphID()); 1411 insertInt("FirstChar", firstGlyphID());
1411 insertInt("LastChar", lastGlyphID()); 1412 insertInt("LastChar", lastGlyphID());
1412 insert("Widths", widthArray.get()); 1413 insert("Widths", widthArray.get());
1413 insertName("CIDToGIDMap", "Identity"); 1414 insertName("CIDToGIDMap", "Identity");
1414 1415
1415 populateToUnicodeTable(NULL); 1416 populateToUnicodeTable(NULL);
1416 return true; 1417 return true;
1417 } 1418 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698