| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 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 SkTypeface_DEFINED | 10 #ifndef SkTypeface_DEFINED |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 size_t getTableData(SkFontTableTag tag, size_t offset, size_t length, | 187 size_t getTableData(SkFontTableTag tag, size_t offset, size_t length, |
| 188 void* data) const; | 188 void* data) const; |
| 189 | 189 |
| 190 /** | 190 /** |
| 191 * Return the units-per-em value for this typeface, or zero if there is an | 191 * Return the units-per-em value for this typeface, or zero if there is an |
| 192 * error. | 192 * error. |
| 193 */ | 193 */ |
| 194 int getUnitsPerEm() const; | 194 int getUnitsPerEm() const; |
| 195 | 195 |
| 196 SkStream* openStream(int* ttcIndex) const; | 196 SkStream* openStream(int* ttcIndex) const; |
| 197 SkScalerContext* createScalerContext(const SkDescriptor*) const; |
| 197 | 198 |
| 198 protected: | 199 protected: |
| 199 /** uniqueID must be unique and non-zero | 200 /** uniqueID must be unique and non-zero |
| 200 */ | 201 */ |
| 201 SkTypeface(Style style, SkFontID uniqueID, bool isFixedWidth = false); | 202 SkTypeface(Style style, SkFontID uniqueID, bool isFixedWidth = false); |
| 202 virtual ~SkTypeface(); | 203 virtual ~SkTypeface(); |
| 203 | 204 |
| 204 friend class SkScalerContext; | 205 friend class SkScalerContext; |
| 205 static SkTypeface* GetDefaultTypeface(); | 206 static SkTypeface* GetDefaultTypeface(); |
| 206 | 207 |
| 207 virtual int onGetUPEM() const; | 208 virtual int onGetUPEM() const; |
| 208 virtual int onGetTableTags(SkFontTableTag tags[]) const; | 209 virtual int onGetTableTags(SkFontTableTag tags[]) const; |
| 209 virtual size_t onGetTableData(SkFontTableTag, size_t offset, | 210 virtual size_t onGetTableData(SkFontTableTag, size_t offset, |
| 210 size_t length, void* data) const; | 211 size_t length, void* data) const; |
| 211 virtual SkScalerContext* onCreateScalerContext(const SkDescriptor*) const; | 212 virtual SkScalerContext* onCreateScalerContext(const SkDescriptor*) const; |
| 212 virtual void onFilterRec(SkScalerContextRec*) const; | 213 virtual void onFilterRec(SkScalerContextRec*) const; |
| 213 virtual void onGetFontDescriptor(SkFontDescriptor*) const; | 214 virtual void onGetFontDescriptor(SkFontDescriptor*) const; |
| 214 | 215 |
| 215 private: | 216 private: |
| 216 SkFontID fUniqueID; | 217 SkFontID fUniqueID; |
| 217 Style fStyle; | 218 Style fStyle; |
| 218 bool fIsFixedWidth; | 219 bool fIsFixedWidth; |
| 219 | 220 |
| 220 friend class SkPaint; | 221 friend class SkPaint; |
| 222 friend class SkGlyphCache; // GetDefaultTypeface |
| 221 // just so deprecated fonthost can call protected methods | 223 // just so deprecated fonthost can call protected methods |
| 222 friend class SkFontHost; | 224 friend class SkFontHost; |
| 223 | 225 |
| 224 typedef SkWeakRefCnt INHERITED; | 226 typedef SkWeakRefCnt INHERITED; |
| 225 }; | 227 }; |
| 226 | 228 |
| 227 #endif | 229 #endif |
| OLD | NEW |