| 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" |
| 11 #include "SkGlyphCache.h" | 11 #include "SkGlyphCache.h" |
| 12 #include "SkPaint.h" | 12 #include "SkPaint.h" |
| 13 #include "SkPDFCatalog.h" | |
| 14 #include "SkPDFCanon.h" | 13 #include "SkPDFCanon.h" |
| 15 #include "SkPDFDevice.h" | 14 #include "SkPDFDevice.h" |
| 16 #include "SkPDFFont.h" | 15 #include "SkPDFFont.h" |
| 17 #include "SkPDFFontImpl.h" | 16 #include "SkPDFFontImpl.h" |
| 18 #include "SkPDFStream.h" | 17 #include "SkPDFStream.h" |
| 19 #include "SkPDFTypes.h" | 18 #include "SkPDFTypes.h" |
| 20 #include "SkPDFUtils.h" | 19 #include "SkPDFUtils.h" |
| 21 #include "SkRefCnt.h" | 20 #include "SkRefCnt.h" |
| 22 #include "SkScalar.h" | 21 #include "SkScalar.h" |
| 23 #include "SkStream.h" | 22 #include "SkStream.h" |
| (...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 if (!canSubset()) { | 1008 if (!canSubset()) { |
| 1010 return NULL; | 1009 return NULL; |
| 1011 } | 1010 } |
| 1012 SkPDFType0Font* newSubset = | 1011 SkPDFType0Font* newSubset = |
| 1013 new SkPDFType0Font(fontInfo(), typeface()); | 1012 new SkPDFType0Font(fontInfo(), typeface()); |
| 1014 newSubset->populate(subset); | 1013 newSubset->populate(subset); |
| 1015 return newSubset; | 1014 return newSubset; |
| 1016 } | 1015 } |
| 1017 | 1016 |
| 1018 #ifdef SK_DEBUG | 1017 #ifdef SK_DEBUG |
| 1019 void SkPDFType0Font::emitObject(SkWStream* stream, SkPDFCatalog* catalog) { | 1018 void SkPDFType0Font::emitObject(SkWStream* stream, |
| 1019 const SkPDFObjNumMap& objNumMap, |
| 1020 const SkPDFSubstituteMap& substitutes) { |
| 1020 SkASSERT(fPopulated); | 1021 SkASSERT(fPopulated); |
| 1021 return INHERITED::emitObject(stream, catalog); | 1022 return INHERITED::emitObject(stream, objNumMap, substitutes); |
| 1022 } | 1023 } |
| 1023 #endif | 1024 #endif |
| 1024 | 1025 |
| 1025 bool SkPDFType0Font::populate(const SkPDFGlyphSet* subset) { | 1026 bool SkPDFType0Font::populate(const SkPDFGlyphSet* subset) { |
| 1026 insertName("Subtype", "Type0"); | 1027 insertName("Subtype", "Type0"); |
| 1027 insertName("BaseFont", fontInfo()->fFontName); | 1028 insertName("BaseFont", fontInfo()->fFontName); |
| 1028 insertName("Encoding", "Identity-H"); | 1029 insertName("Encoding", "Identity-H"); |
| 1029 | 1030 |
| 1030 SkAutoTUnref<SkPDFCIDFont> newCIDFont( | 1031 SkAutoTUnref<SkPDFCIDFont> newCIDFont( |
| 1031 new SkPDFCIDFont(fontInfo(), typeface(), subset)); | 1032 new SkPDFCIDFont(fontInfo(), typeface(), subset)); |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1418 } | 1419 } |
| 1419 if (existingFont != NULL) { | 1420 if (existingFont != NULL) { |
| 1420 return (existingFont->fFirstGlyphID <= searchGlyphID && | 1421 return (existingFont->fFirstGlyphID <= searchGlyphID && |
| 1421 searchGlyphID <= existingFont->fLastGlyphID) | 1422 searchGlyphID <= existingFont->fLastGlyphID) |
| 1422 ? SkPDFFont::kExact_Match | 1423 ? SkPDFFont::kExact_Match |
| 1423 : SkPDFFont::kRelated_Match; | 1424 : SkPDFFont::kRelated_Match; |
| 1424 } | 1425 } |
| 1425 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match | 1426 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match |
| 1426 : SkPDFFont::kRelated_Match; | 1427 : SkPDFFont::kRelated_Match; |
| 1427 } | 1428 } |
| OLD | NEW |