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

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: 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/ports/SkFontHost_win.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 /**
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
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
OLDNEW
« no previous file with comments | « no previous file | src/core/SkTypeface.cpp » ('j') | src/ports/SkFontHost_win.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698