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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 bool hasGlyph(uint16_t glyphID); | 99 bool hasGlyph(uint16_t glyphID); |
100 | 100 |
101 /** Convert (in place) the input glyph IDs into the font encoding. If the | 101 /** Convert (in place) the input glyph IDs into the font encoding. If the |
102 * font has more glyphs than can be encoded (like a type 1 font with more | 102 * font has more glyphs than can be encoded (like a type 1 font with more |
103 * than 255 glyphs) this method only converts up to the first out of range | 103 * than 255 glyphs) this method only converts up to the first out of range |
104 * glyph ID. | 104 * glyph ID. |
105 * @param glyphIDs The input text as glyph IDs. | 105 * @param glyphIDs The input text as glyph IDs. |
106 * @param numGlyphs The number of input glyphs. | 106 * @param numGlyphs The number of input glyphs. |
107 * @return Returns the number of glyphs consumed. | 107 * @return Returns the number of glyphs consumed. |
108 */ | 108 */ |
109 int glyphsToPDFFontEncoding(SkGlyphID* glyphIDs, int numGlyphs) const; | 109 int glyphsToPDFFontEncoding(uint16_t* glyphIDs, int numGlyphs); |
110 /** | |
111 * Like above, but does not modify glyphIDs array. | |
112 */ | |
113 int glyphsToPDFFontEncodingCount(const SkGlyphID* glyphIDs, | |
114 int numGlyphs) const; | |
115 | 110 |
116 /** Get the font resource for the passed typeface and glyphID. The | 111 /** Get the font resource for the passed typeface and glyphID. The |
117 * reference count of the object is incremented and it is the caller's | 112 * reference count of the object is incremented and it is the caller's |
118 * responsibility to unreference it when done. This is needed to | 113 * responsibility to unreference it when done. This is needed to |
119 * accommodate the weak reference pattern used when the returned object | 114 * accommodate the weak reference pattern used when the returned object |
120 * is new and has no other references. | 115 * is new and has no other references. |
121 * @param typeface The typeface to find. | 116 * @param typeface The typeface to find. |
122 * @param glyphID Specify which section of a large font is of interest. | 117 * @param glyphID Specify which section of a large font is of interest. |
123 */ | 118 */ |
124 static SkPDFFont* GetFontResource(SkPDFCanon* canon, | 119 static SkPDFFont* GetFontResource(SkPDFCanon* canon, |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 uint16_t fLastGlyphID; | 200 uint16_t fLastGlyphID; |
206 sk_sp<const SkAdvancedTypefaceMetrics> fFontInfo; | 201 sk_sp<const SkAdvancedTypefaceMetrics> fFontInfo; |
207 sk_sp<SkPDFDict> fDescriptor; | 202 sk_sp<SkPDFDict> fDescriptor; |
208 | 203 |
209 SkAdvancedTypefaceMetrics::FontType fFontType; | 204 SkAdvancedTypefaceMetrics::FontType fFontType; |
210 | 205 |
211 typedef SkPDFDict INHERITED; | 206 typedef SkPDFDict INHERITED; |
212 }; | 207 }; |
213 | 208 |
214 #endif | 209 #endif |
OLD | NEW |