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