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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 append_tounicode_header(&cmap, 1, lastGlyphID - firstGlyphID + 1); | 571 append_tounicode_header(&cmap, 1, lastGlyphID - firstGlyphID + 1); |
572 } | 572 } |
573 append_cmap_sections(glyphToUnicode, subset, &cmap, multiByteGlyphs, | 573 append_cmap_sections(glyphToUnicode, subset, &cmap, multiByteGlyphs, |
574 firstGlyphID, lastGlyphID); | 574 firstGlyphID, lastGlyphID); |
575 append_cmap_footer(&cmap); | 575 append_cmap_footer(&cmap); |
576 SkAutoTUnref<SkData> cmapData(cmap.copyToData()); | 576 SkAutoTUnref<SkData> cmapData(cmap.copyToData()); |
577 return new SkPDFStream(cmapData.get()); | 577 return new SkPDFStream(cmapData.get()); |
578 } | 578 } |
579 | 579 |
580 #if defined (SK_SFNTLY_SUBSETTER) | 580 #if defined (SK_SFNTLY_SUBSETTER) |
581 static void sk_delete_array(const void* ptr, size_t, void*) { | 581 static void sk_delete_array(const void* ptr, void*) { |
582 // Use C-style cast to cast away const and cast type simultaneously. | 582 // Use C-style cast to cast away const and cast type simultaneously. |
583 delete[] (unsigned char*)ptr; | 583 delete[] (unsigned char*)ptr; |
584 } | 584 } |
585 #endif | 585 #endif |
586 | 586 |
587 static size_t get_subset_font_stream(const char* fontName, | 587 static size_t get_subset_font_stream(const char* fontName, |
588 const SkTypeface* typeface, | 588 const SkTypeface* typeface, |
589 const SkTDArray<uint32_t>& subset, | 589 const SkTDArray<uint32_t>& subset, |
590 SkPDFStream** fontStream) { | 590 SkPDFStream** fontStream) { |
591 int ttcIndex; | 591 int ttcIndex; |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 } | 1414 } |
1415 if (existingFont != NULL) { | 1415 if (existingFont != NULL) { |
1416 return (existingFont->fFirstGlyphID <= searchGlyphID && | 1416 return (existingFont->fFirstGlyphID <= searchGlyphID && |
1417 searchGlyphID <= existingFont->fLastGlyphID) | 1417 searchGlyphID <= existingFont->fLastGlyphID) |
1418 ? SkPDFFont::kExact_Match | 1418 ? SkPDFFont::kExact_Match |
1419 : SkPDFFont::kRelated_Match; | 1419 : SkPDFFont::kRelated_Match; |
1420 } | 1420 } |
1421 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match | 1421 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match |
1422 : SkPDFFont::kRelated_Match; | 1422 : SkPDFFont::kRelated_Match; |
1423 } | 1423 } |
OLD | NEW |