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 /** Return a new reference to the typeface that most closely matches the | 102 /** Creates a new reference to the typeface that most closely matches the |
103 requested familyName and style. Pass null as the familyName to return | 103 requested familyName and fontStyle. This method allows extended font |
104 the default font for the requested style. Will never return null | 104 face specifiers as in the SkFontStyle type. Will never return null. |
105 | 105 |
106 @param familyName May be NULL. The name of the font family. | 106 @param familyName May be NULL. The name of the font family. |
107 @param style The style (normal, bold, italic) of the typeface. | 107 @param fontStyle The style of the typeface. |
108 @return reference to the closest-matching typeface. Call must call | 108 @return reference to the closest-matching typeface. Call must call |
109 unref() when they are done. | 109 unref() when they are done. |
110 */ | 110 */ |
111 static SkTypeface* CreateFromName(const char familyName[], Style style); | 111 static SkTypeface* CreateFromName(const char familyName[], |
bungeman-skia
2016/03/22 20:16:43
You're not going to be able to change this signatu
Mikus
2016/03/24 12:08:26
Done. Added and ifdef for the legacy code.
| |
112 SkFontStyle fontStyle); | |
112 | 113 |
113 /** Return a new reference to the typeface that most closely matches the | 114 /** Return a new reference to the typeface that most closely matches the |
114 requested typeface and specified Style. Use this call if you want to | 115 requested typeface and specified Style. Use this call if you want to |
115 pick a new style from the same family of the existing typeface. | 116 pick a new style from the same family of the existing typeface. |
116 If family is NULL, this selects from the default font's family. | 117 If family is NULL, this selects from the default font's family. |
117 | 118 |
118 @param family May be NULL. The name of the existing type face. | 119 @param family May be NULL. The name of the existing type face. |
119 @param s The style (normal, bold, italic) of the type face. | 120 @param s The style (normal, bold, italic) of the type face. |
120 @return reference to the closest-matching typeface. Call must call | 121 @return reference to the closest-matching typeface. Call must call |
121 unref() when they are done. | 122 unref() when they are done. |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
403 SkFontStyle fStyle; | 404 SkFontStyle fStyle; |
404 bool fIsFixedPitch; | 405 bool fIsFixedPitch; |
405 | 406 |
406 friend class SkPaint; | 407 friend class SkPaint; |
407 friend class SkGlyphCache; // GetDefaultTypeface | 408 friend class SkGlyphCache; // GetDefaultTypeface |
408 | 409 |
409 typedef SkWeakRefCnt INHERITED; | 410 typedef SkWeakRefCnt INHERITED; |
410 }; | 411 }; |
411 | 412 |
412 #endif | 413 #endif |
OLD | NEW |