OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |