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 (SK_SFNTLY_SUBSETTER) | |
28 #include SK_SFNTLY_SUBSETTER | |
29 #endif | |
30 | |
31 #if defined (GOOGLE3) | 27 #if defined (GOOGLE3) |
32 // #including #defines doesn't work in with this build system. | 28 // #including #defines doesn't work in with this build system. |
33 #include "typography/font/sfntly/src/sample/chromium/font_subsetter.h" | 29 #include "typography/font/sfntly/src/sample/chromium/font_subsetter.h" |
34 #define SK_SFNTLY_SUBSETTER // For the benefit of #ifdefs below. | 30 #define SK_SFNTLY_SUBSETTER // For the benefit of #ifdefs below. |
| 31 #elif defined (SK_SFNTLY_SUBSETTER) |
| 32 #include SK_SFNTLY_SUBSETTER |
35 #endif | 33 #endif |
36 | 34 |
37 // 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 |
38 // 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 |
39 // 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) |
40 static const int kPdfSymbolic = 4; | 38 static const int kPdfSymbolic = 4; |
41 | 39 |
42 namespace { | 40 namespace { |
43 | 41 |
44 /////////////////////////////////////////////////////////////////////////////// | 42 /////////////////////////////////////////////////////////////////////////////// |
(...skipping 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 } | 1416 } |
1419 if (existingFont != NULL) { | 1417 if (existingFont != NULL) { |
1420 return (existingFont->fFirstGlyphID <= searchGlyphID && | 1418 return (existingFont->fFirstGlyphID <= searchGlyphID && |
1421 searchGlyphID <= existingFont->fLastGlyphID) | 1419 searchGlyphID <= existingFont->fLastGlyphID) |
1422 ? SkPDFFont::kExact_Match | 1420 ? SkPDFFont::kExact_Match |
1423 : SkPDFFont::kRelated_Match; | 1421 : SkPDFFont::kRelated_Match; |
1424 } | 1422 } |
1425 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match | 1423 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match |
1426 : SkPDFFont::kRelated_Match; | 1424 : SkPDFFont::kRelated_Match; |
1427 } | 1425 } |
OLD | NEW |