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 | 8 |
9 #ifndef SkPDFFont_DEFINED | 9 #ifndef SkPDFFont_DEFINED |
10 #define SkPDFFont_DEFINED | 10 #define SkPDFFont_DEFINED |
(...skipping 22 matching lines...) Expand all Loading... |
33 /** Returns the typeface represented by this class. Returns nullptr for the | 33 /** Returns the typeface represented by this class. Returns nullptr for the |
34 * default typeface. | 34 * default typeface. |
35 */ | 35 */ |
36 SkTypeface* typeface() const { return fTypeface.get(); } | 36 SkTypeface* typeface() const { return fTypeface.get(); } |
37 | 37 |
38 /** Returns the font type represented in this font. For Type0 fonts, | 38 /** Returns the font type represented in this font. For Type0 fonts, |
39 * returns the type of the decendant font. | 39 * returns the type of the decendant font. |
40 */ | 40 */ |
41 SkAdvancedTypefaceMetrics::FontType getType() const { return fFontType; } | 41 SkAdvancedTypefaceMetrics::FontType getType() const { return fFontType; } |
42 | 42 |
| 43 static SkAdvancedTypefaceMetrics::FontType FontType(const SkAdvancedTypeface
Metrics&); |
| 44 |
43 static bool IsMultiByte(SkAdvancedTypefaceMetrics::FontType type) { | 45 static bool IsMultiByte(SkAdvancedTypefaceMetrics::FontType type) { |
44 return type == SkAdvancedTypefaceMetrics::kType1CID_Font || | 46 return type == SkAdvancedTypefaceMetrics::kType1CID_Font || |
45 type == SkAdvancedTypefaceMetrics::kTrueType_Font; | 47 type == SkAdvancedTypefaceMetrics::kTrueType_Font; |
46 } | 48 } |
47 | 49 |
48 /** Returns true if this font encoding supports glyph IDs above 255. | 50 /** Returns true if this font encoding supports glyph IDs above 255. |
49 */ | 51 */ |
50 bool multiByteGlyphs() const { return SkPDFFont::IsMultiByte(this->getType()
); } | 52 bool multiByteGlyphs() const { return SkPDFFont::IsMultiByte(this->getType()
); } |
51 | 53 |
52 /** Return true if this font has an encoding for the passed glyph id. | 54 /** Return true if this font has an encoding for the passed glyph id. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // The glyph IDs accessible with this font. For Type1 (non CID) fonts, | 145 // The glyph IDs accessible with this font. For Type1 (non CID) fonts, |
144 // this will be a subset if the font has more than 255 glyphs. | 146 // this will be a subset if the font has more than 255 glyphs. |
145 const SkGlyphID fFirstGlyphID; | 147 const SkGlyphID fFirstGlyphID; |
146 const SkGlyphID fLastGlyphID; | 148 const SkGlyphID fLastGlyphID; |
147 const SkAdvancedTypefaceMetrics::FontType fFontType; | 149 const SkAdvancedTypefaceMetrics::FontType fFontType; |
148 | 150 |
149 typedef SkPDFDict INHERITED; | 151 typedef SkPDFDict INHERITED; |
150 }; | 152 }; |
151 | 153 |
152 #endif | 154 #endif |
OLD | NEW |