Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: include/core/SkTypeface.h

Issue 1818043002: SkTypeface::MakeFromName to take SkFontStyle. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Decrease the change scope for changing the width to a generic one. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/core/SkTypeface.cpp » ('j') | src/core/SkTypeface.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/core/SkTypeface.cpp » ('j') | src/core/SkTypeface.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698