| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 #ifndef SkTypeface_DEFINED | 8 #ifndef SkTypeface_DEFINED |
| 9 #define SkTypeface_DEFINED | 9 #define SkTypeface_DEFINED |
| 10 | 10 |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 // for Type 1 fonts | 339 // for Type 1 fonts |
| 340 }; | 340 }; |
| 341 | 341 |
| 342 /** uniqueID must be unique and non-zero | 342 /** uniqueID must be unique and non-zero |
| 343 */ | 343 */ |
| 344 SkTypeface(const SkFontStyle& style, bool isFixedPitch = false); | 344 SkTypeface(const SkFontStyle& style, bool isFixedPitch = false); |
| 345 virtual ~SkTypeface(); | 345 virtual ~SkTypeface(); |
| 346 | 346 |
| 347 /** Sets the fixedPitch bit. If used, must be called in the constructor. */ | 347 /** Sets the fixedPitch bit. If used, must be called in the constructor. */ |
| 348 void setIsFixedPitch(bool isFixedPitch) { fIsFixedPitch = isFixedPitch; } | 348 void setIsFixedPitch(bool isFixedPitch) { fIsFixedPitch = isFixedPitch; } |
| 349 /** Sets the font style. If used, must be called in the constructor. */ |
| 350 void setFontStyle(SkFontStyle style) { fStyle = style; } |
| 349 | 351 |
| 350 friend class SkScalerContext; | 352 friend class SkScalerContext; |
| 351 static SkTypeface* GetDefaultTypeface(Style style = SkTypeface::kNormal); | 353 static SkTypeface* GetDefaultTypeface(Style style = SkTypeface::kNormal); |
| 352 | 354 |
| 353 virtual SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&
, | 355 virtual SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&
, |
| 354 const SkDescriptor*) const =
0; | 356 const SkDescriptor*) const =
0; |
| 355 virtual void onFilterRec(SkScalerContextRec*) const = 0; | 357 virtual void onFilterRec(SkScalerContextRec*) const = 0; |
| 356 virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics( | 358 virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics( |
| 357 PerGlyphInfo, | 359 PerGlyphInfo, |
| 358 const uint32_t* glyphIDs, | 360 const uint32_t* glyphIDs, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 mutable SkOnce fBoundsOnce; | 418 mutable SkOnce fBoundsOnce; |
| 417 bool fIsFixedPitch; | 419 bool fIsFixedPitch; |
| 418 | 420 |
| 419 friend class SkPaint; | 421 friend class SkPaint; |
| 420 friend class SkGlyphCache; // GetDefaultTypeface | 422 friend class SkGlyphCache; // GetDefaultTypeface |
| 421 | 423 |
| 422 typedef SkWeakRefCnt INHERITED; | 424 typedef SkWeakRefCnt INHERITED; |
| 423 }; | 425 }; |
| 424 | 426 |
| 425 #endif | 427 #endif |
| OLD | NEW |