| 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 "SkData.h" | 8 #include "SkData.h" |
| 9 #include "SkGlyphCache.h" | 9 #include "SkGlyphCache.h" |
| 10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
| 11 #include "SkPDFCanon.h" | 11 #include "SkPDFCanon.h" |
| 12 #include "SkPDFConvertType1FontStream.h" | 12 #include "SkPDFConvertType1FontStream.h" |
| 13 #include "SkPDFDevice.h" | 13 #include "SkPDFDevice.h" |
| 14 #include "SkPDFMakeCIDGlyphWidthsArray.h" | 14 #include "SkPDFMakeCIDGlyphWidthsArray.h" |
| 15 #include "SkPDFMakeToUnicodeCmap.h" | 15 #include "SkPDFMakeToUnicodeCmap.h" |
| 16 #include "SkPDFFont.h" | 16 #include "SkPDFFont.h" |
| 17 #include "SkPDFUtils.h" | 17 #include "SkPDFUtils.h" |
| 18 #include "SkRefCnt.h" | 18 #include "SkRefCnt.h" |
| 19 #include "SkScalar.h" | 19 #include "SkScalar.h" |
| 20 #include "SkStream.h" | 20 #include "SkStream.h" |
| 21 #include "SkTypefacePriv.h" | 21 #include "SkTypefacePriv.h" |
| 22 #include "SkTypes.h" | 22 #include "SkTypes.h" |
| 23 #include "SkUtils.h" | 23 #include "SkUtils.h" |
| 24 | 24 |
| 25 #if defined (SK_SFNTLY_SUBSETTER) | 25 #if defined (SK_SFNTLY_SUBSETTER) |
| 26 #if defined (GOOGLE3) | 26 #if defined (GOOGLE3) |
| 27 // #including #defines doesn't work with this build system. | 27 // #including #defines doesn't work with this build system. |
| 28 #include "typography/font/sfntly/src/sample/chromium/font_subsetter.h" | 28 #include "sample/chromium/font_subsetter.h" |
| 29 #else | 29 #else |
| 30 #include SK_SFNTLY_SUBSETTER | 30 #include SK_SFNTLY_SUBSETTER |
| 31 #endif | 31 #endif |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 namespace { | 34 namespace { |
| 35 // PDF's notion of symbolic vs non-symbolic is related to the character set, not | 35 // PDF's notion of symbolic vs non-symbolic is related to the character set, not |
| 36 // symbols vs. characters. Rarely is a font the right character set to call it | 36 // symbols vs. characters. Rarely is a font the right character set to call it |
| 37 // non-symbolic, so always call it symbolic. (PDF 1.4 spec, section 5.7.1) | 37 // non-symbolic, so always call it symbolic. (PDF 1.4 spec, section 5.7.1) |
| 38 static const int kPdfSymbolic = 4; | 38 static const int kPdfSymbolic = 4; |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 | 755 |
| 756 bool SkPDFFont::CanEmbedTypeface(SkTypeface* typeface, SkPDFCanon* canon) { | 756 bool SkPDFFont::CanEmbedTypeface(SkTypeface* typeface, SkPDFCanon* canon) { |
| 757 const SkAdvancedTypefaceMetrics* metrics = SkPDFFont::GetMetrics(typeface, c
anon); | 757 const SkAdvancedTypefaceMetrics* metrics = SkPDFFont::GetMetrics(typeface, c
anon); |
| 758 return metrics && can_embed(*metrics); | 758 return metrics && can_embed(*metrics); |
| 759 } | 759 } |
| 760 | 760 |
| 761 void SkPDFFont::drop() { | 761 void SkPDFFont::drop() { |
| 762 fTypeface = nullptr; | 762 fTypeface = nullptr; |
| 763 this->SkPDFDict::drop(); | 763 this->SkPDFDict::drop(); |
| 764 } | 764 } |
| OLD | NEW |