Chromium Code Reviews| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 handling either being null (treating null as the default font) | 92 handling either being null (treating null as the default font) |
| 93 */ | 93 */ |
| 94 static bool Equal(const SkTypeface* facea, const SkTypeface* faceb); | 94 static bool Equal(const SkTypeface* facea, const SkTypeface* faceb); |
| 95 | 95 |
| 96 /** | 96 /** |
| 97 * Returns a ref() to the default typeface. The caller must call unref() | 97 * Returns a ref() to the default typeface. The caller must call unref() |
| 98 * when they are done referencing the object. Never returns NULL. | 98 * when they are done referencing the object. Never returns NULL. |
| 99 */ | 99 */ |
| 100 static SkTypeface* RefDefault(Style style = SkTypeface::kNormal); | 100 static SkTypeface* RefDefault(Style style = SkTypeface::kNormal); |
| 101 | 101 |
| 102 /** | |
| 103 Creates a new reference to the typeface that most closely matches the | |
| 104 requested familyName and fontStyle. This method allows extended font | |
| 105 face specifiers as in the SkFontStyle type. | |
| 106 */ | |
| 107 static SkTypeface* CreateFromNameAndStyle(const char familyName[], | |
|
bungeman-skia
2016/03/21 16:14:26
All of the static 'Create' methods on Typeface are
| |
| 108 SkFontStyle fontStyle); | |
| 109 | |
| 102 /** Return a new reference to the typeface that most closely matches the | 110 /** Return a new reference to the typeface that most closely matches the |
| 103 requested familyName and style. Pass null as the familyName to return | 111 requested familyName and style. Pass null as the familyName to return |
| 104 the default font for the requested style. Will never return null | 112 the default font for the requested style. Will never return null |
| 105 | 113 |
| 106 @param familyName May be NULL. The name of the font family. | 114 @param familyName May be NULL. The name of the font family. |
| 107 @param style The style (normal, bold, italic) of the typeface. | 115 @param style The style (normal, bold, italic) of the typeface. |
| 108 @return reference to the closest-matching typeface. Call must call | 116 @return reference to the closest-matching typeface. Call must call |
| 109 unref() when they are done. | 117 unref() when they are done. |
| 110 */ | 118 */ |
| 111 static SkTypeface* CreateFromName(const char familyName[], Style style); | 119 static SkTypeface* CreateFromName(const char familyName[], Style style); |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 403 SkFontStyle fStyle; | 411 SkFontStyle fStyle; |
| 404 bool fIsFixedPitch; | 412 bool fIsFixedPitch; |
| 405 | 413 |
| 406 friend class SkPaint; | 414 friend class SkPaint; |
| 407 friend class SkGlyphCache; // GetDefaultTypeface | 415 friend class SkGlyphCache; // GetDefaultTypeface |
| 408 | 416 |
| 409 typedef SkWeakRefCnt INHERITED; | 417 typedef SkWeakRefCnt INHERITED; |
| 410 }; | 418 }; |
| 411 | 419 |
| 412 #endif | 420 #endif |
| OLD | NEW |