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 SkAdvancedTypefaceMetrics_DEFINED | 9 #ifndef SkAdvancedTypefaceMetrics_DEFINED |
10 #define SkAdvancedTypefaceMetrics_DEFINED | 10 #define SkAdvancedTypefaceMetrics_DEFINED |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 @param glyphIDs For per-glyph info, specify subset of the | 48 @param glyphIDs For per-glyph info, specify subset of the |
49 font by giving glyph ids. Each integer | 49 font by giving glyph ids. Each integer |
50 represents a glyph id. Passing nullptr | 50 represents a glyph id. Passing nullptr |
51 means all glyphs in the font. | 51 means all glyphs in the font. |
52 @param glyphIDsCount Number of elements in subsetGlyphIds. | 52 @param glyphIDsCount Number of elements in subsetGlyphIds. |
53 Ignored if glyphIDs is nullptr. | 53 Ignored if glyphIDs is nullptr. |
54 @param getAdvance A function that takes a glyph id and | 54 @param getAdvance A function that takes a glyph id and |
55 passes back advance data from the | 55 passes back advance data from the |
56 typeface. Returns false on failure. | 56 typeface. Returns false on failure. |
57 */ | 57 */ |
58 template <typename FontHandle> | 58 typedef std::function<bool(int glyphId, int16_t* advanceData)> GetAdvance; |
59 void setGlyphWidths(FontHandle fontHandle, | 59 void setGlyphWidths(int num_glyphs, |
60 int num_glyphs, | |
61 const uint32_t* subsetGlyphIDs, | 60 const uint32_t* subsetGlyphIDs, |
62 uint32_t subsetGlyphIDsLength, | 61 uint32_t subsetGlyphIDsLength, |
63 bool (*getAdvance)(FontHandle fontHandle, | 62 GetAdvance getAdvance); |
64 int gId, | |
65 int16_t* data)); | |
66 | 63 |
67 SkString fFontName; | 64 SkString fFontName; |
68 | 65 |
69 enum FontType { | 66 enum FontType { |
70 kType1_Font, | 67 kType1_Font, |
71 kType1CID_Font, | 68 kType1CID_Font, |
72 kCFF_Font, | 69 kCFF_Font, |
73 kTrueType_Font, | 70 kTrueType_Font, |
74 kOther_Font, | 71 kOther_Font, |
75 }; | 72 }; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 static void FinishRange(WidthRange* range, | 160 static void FinishRange(WidthRange* range, |
164 int endId, | 161 int endId, |
165 WidthRange::MetricType type); | 162 WidthRange::MetricType type); |
166 | 163 |
167 private: | 164 private: |
168 typedef SkRefCnt INHERITED; | 165 typedef SkRefCnt INHERITED; |
169 }; | 166 }; |
170 | 167 |
171 | 168 |
172 #endif | 169 #endif |
OLD | NEW |