| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkAdvancedTypefaceMetrics_DEFINED | 10 #ifndef SkAdvancedTypefaceMetrics_DEFINED |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 int16_t fItalicAngle; // Counterclockwise degrees from vertical of the | 67 int16_t fItalicAngle; // Counterclockwise degrees from vertical of the |
| 68 // dominant vertical stroke for an Italic face. | 68 // dominant vertical stroke for an Italic face. |
| 69 // The following fields are all in font units. | 69 // The following fields are all in font units. |
| 70 int16_t fAscent; // Max height above baseline, not including accents. | 70 int16_t fAscent; // Max height above baseline, not including accents. |
| 71 int16_t fDescent; // Max depth below baseline (negative). | 71 int16_t fDescent; // Max depth below baseline (negative). |
| 72 int16_t fStemV; // Thickness of dominant vertical stem. | 72 int16_t fStemV; // Thickness of dominant vertical stem. |
| 73 int16_t fCapHeight; // Height (from baseline) of top of flat capitals. | 73 int16_t fCapHeight; // Height (from baseline) of top of flat capitals. |
| 74 | 74 |
| 75 SkIRect fBBox; // The bounding box of all glyphs (in font units). | 75 SkIRect fBBox; // The bounding box of all glyphs (in font units). |
| 76 | 76 |
| 77 // The type of advance data wanted. | |
| 78 enum PerGlyphInfo { | |
| 79 kNo_PerGlyphInfo = 0x0, // Don't populate any per glyph info. | |
| 80 kHAdvance_PerGlyphInfo = 0x1, // Populate horizontal advance data. | |
| 81 kVAdvance_PerGlyphInfo = 0x2, // Populate vertical advance data. | |
| 82 kGlyphNames_PerGlyphInfo = 0x4, // Populate glyph names (Type 1 only). | |
| 83 kToUnicode_PerGlyphInfo = 0x8 // Populate ToUnicode table, ignored | |
| 84 // for Type 1 fonts | |
| 85 }; | |
| 86 | |
| 87 template <typename Data> | 77 template <typename Data> |
| 88 struct AdvanceMetric { | 78 struct AdvanceMetric { |
| 89 enum MetricType { | 79 enum MetricType { |
| 90 kDefault, // Default advance: fAdvance.count = 1 | 80 kDefault, // Default advance: fAdvance.count = 1 |
| 91 kRange, // Advances for a range: fAdvance.count = fEndID-fStartID | 81 kRange, // Advances for a range: fAdvance.count = fEndID-fStartID |
| 92 kRun // fStartID-fEndID have same advance: fAdvance.count = 1 | 82 kRun // fStartID-fEndID have same advance: fAdvance.count = 1 |
| 93 }; | 83 }; |
| 94 MetricType fType; | 84 MetricType fType; |
| 95 uint16_t fStartId; | 85 uint16_t fStartId; |
| 96 uint16_t fEndId; | 86 uint16_t fEndId; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 SkAdvancedTypefaceMetrics::AdvanceMetric<Data>* getAdvanceData( | 143 SkAdvancedTypefaceMetrics::AdvanceMetric<Data>* getAdvanceData( |
| 154 FontHandle fontHandle, | 144 FontHandle fontHandle, |
| 155 int num_glyphs, | 145 int num_glyphs, |
| 156 const uint32_t* glyphIDs, | 146 const uint32_t* glyphIDs, |
| 157 uint32_t glyphIDsCount, | 147 uint32_t glyphIDsCount, |
| 158 bool (*getAdvance)(FontHandle fontHandle, int gId, Data* data)); | 148 bool (*getAdvance)(FontHandle fontHandle, int gId, Data* data)); |
| 159 | 149 |
| 160 } // namespace skia_advanced_typeface_metrics_utils | 150 } // namespace skia_advanced_typeface_metrics_utils |
| 161 | 151 |
| 162 #endif | 152 #endif |
| OLD | NEW |