| 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" |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 #if !defined (SK_SFNTLY_SUBSETTER) | 836 #if !defined (SK_SFNTLY_SUBSETTER) |
| 837 info = SkTBitOr<SkTypeface::PerGlyphInfo>( | 837 info = SkTBitOr<SkTypeface::PerGlyphInfo>( |
| 838 info, SkTypeface::kHAdvance_PerGlyphInfo); | 838 info, SkTypeface::kHAdvance_PerGlyphInfo); |
| 839 #endif | 839 #endif |
| 840 fontMetrics.reset( | 840 fontMetrics.reset( |
| 841 typeface->getAdvancedTypefaceMetrics(info, NULL, 0)); | 841 typeface->getAdvancedTypefaceMetrics(info, NULL, 0)); |
| 842 #if defined (SK_SFNTLY_SUBSETTER) | 842 #if defined (SK_SFNTLY_SUBSETTER) |
| 843 if (fontMetrics.get() && | 843 if (fontMetrics.get() && |
| 844 fontMetrics->fType != SkAdvancedTypefaceMetrics::kTrueType_Font) { | 844 fontMetrics->fType != SkAdvancedTypefaceMetrics::kTrueType_Font) { |
| 845 // Font does not support subsetting, get new info with advance. | 845 // Font does not support subsetting, get new info with advance. |
| 846 info = SkTBitOr<SkAdvancedTypefaceMetrics::PerGlyphInfo>( | 846 info = SkTBitOr<SkTypeface::PerGlyphInfo>( |
| 847 info, kHAdvance_PerGlyphInfo); | 847 info, SkTypeface::kHAdvance_PerGlyphInfo); |
| 848 fontMetrics.reset( | 848 fontMetrics.reset( |
| 849 typeface->getAdvancedTypefaceMetrics(info, NULL, 0)); | 849 typeface->getAdvancedTypefaceMetrics(info, NULL, 0)); |
| 850 } | 850 } |
| 851 #endif | 851 #endif |
| 852 } | 852 } |
| 853 | 853 |
| 854 SkPDFFont* font = SkPDFFont::Create(canon, fontMetrics.get(), typeface, | 854 SkPDFFont* font = SkPDFFont::Create(canon, fontMetrics.get(), typeface, |
| 855 glyphID, relatedFontDescriptor); | 855 glyphID, relatedFontDescriptor); |
| 856 canon->addFont(font, fontID, font->fFirstGlyphID); | 856 canon->addFont(font, fontID, font->fFirstGlyphID); |
| 857 return font; | 857 return font; |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1418 } | 1418 } |
| 1419 if (existingFont != NULL) { | 1419 if (existingFont != NULL) { |
| 1420 return (existingFont->fFirstGlyphID <= searchGlyphID && | 1420 return (existingFont->fFirstGlyphID <= searchGlyphID && |
| 1421 searchGlyphID <= existingFont->fLastGlyphID) | 1421 searchGlyphID <= existingFont->fLastGlyphID) |
| 1422 ? SkPDFFont::kExact_Match | 1422 ? SkPDFFont::kExact_Match |
| 1423 : SkPDFFont::kRelated_Match; | 1423 : SkPDFFont::kRelated_Match; |
| 1424 } | 1424 } |
| 1425 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match | 1425 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match |
| 1426 : SkPDFFont::kRelated_Match; | 1426 : SkPDFFont::kRelated_Match; |
| 1427 } | 1427 } |
| OLD | NEW |