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 "SkPDFCanon.h" | 13 #include "SkPDFCanon.h" |
14 #include "SkPDFDevice.h" | 14 #include "SkPDFDevice.h" |
15 #include "SkPDFFont.h" | 15 #include "SkPDFFont.h" |
16 #include "SkPDFFontImpl.h" | 16 #include "SkPDFFontImpl.h" |
17 #include "SkPDFStream.h" | 17 #include "SkPDFStream.h" |
18 #include "SkPDFTypes.h" | 18 #include "SkPDFTypes.h" |
19 #include "SkPDFUtils.h" | 19 #include "SkPDFUtils.h" |
20 #include "SkRefCnt.h" | 20 #include "SkRefCnt.h" |
21 #include "SkScalar.h" | 21 #include "SkScalar.h" |
22 #include "SkStream.h" | 22 #include "SkStream.h" |
23 #include "SkTypefacePriv.h" | 23 #include "SkTypefacePriv.h" |
24 #include "SkTypes.h" | 24 #include "SkTypes.h" |
25 #include "SkUtils.h" | 25 #include "SkUtils.h" |
26 | 26 |
27 #if defined (GOOGLE3) | 27 #if defined (GOOGLE3) |
28 // #including #defines doesn't work in with this build system. | 28 #if !defined (SK_BUILD_FOR_ANDROID) |
29 #include "typography/font/sfntly/src/sample/chromium/font_subsetter.h" | 29 // #including #defines doesn't work with this build system. |
30 #define SK_SFNTLY_SUBSETTER // For the benefit of #ifdefs below. | 30 #include "typography/font/sfntly/src/sample/chromium/font_subsetter.h" |
| 31 #define SK_SFNTLY_SUBSETTER // For the benefit of #ifdefs below. |
| 32 #endif |
31 #elif defined (SK_SFNTLY_SUBSETTER) | 33 #elif defined (SK_SFNTLY_SUBSETTER) |
32 #include SK_SFNTLY_SUBSETTER | 34 #include SK_SFNTLY_SUBSETTER |
33 #endif | 35 #endif |
34 | 36 |
35 // PDF's notion of symbolic vs non-symbolic is related to the character set, not | 37 // 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 | 38 // 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) | 39 // non-symbolic, so always call it symbolic. (PDF 1.4 spec, section 5.7.1) |
38 static const int kPdfSymbolic = 4; | 40 static const int kPdfSymbolic = 4; |
39 | 41 |
40 namespace { | 42 namespace { |
(...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1426 SkAutoTUnref<const SkAdvancedTypefaceMetrics> fontMetrics( | 1428 SkAutoTUnref<const SkAdvancedTypefaceMetrics> fontMetrics( |
1427 face->getAdvancedTypefaceMetrics( | 1429 face->getAdvancedTypefaceMetrics( |
1428 SkTypeface::kNo_PerGlyphInfo, nullptr, 0)); | 1430 SkTypeface::kNo_PerGlyphInfo, nullptr, 0)); |
1429 if (fontMetrics) { | 1431 if (fontMetrics) { |
1430 canEmbed = !SkToBool( | 1432 canEmbed = !SkToBool( |
1431 fontMetrics->fFlags & | 1433 fontMetrics->fFlags & |
1432 SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag); | 1434 SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag); |
1433 } | 1435 } |
1434 return *canon->fCanEmbedTypeface.set(id, canEmbed); | 1436 return *canon->fCanEmbedTypeface.set(id, canEmbed); |
1435 } | 1437 } |
OLD | NEW |