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

Unified Diff: include/core/SkTypeface.h

Issue 1818043002: SkTypeface::MakeFromName to take SkFontStyle. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Add the legacy code back 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkTypeface.cpp » ('j') | src/core/SkTypeface.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkTypeface.h
diff --git a/include/core/SkTypeface.h b/include/core/SkTypeface.h
index 0b1ca6a4bdaf02c231fa61fe2e62a68f24b94672..fa1ffe539bedcd7a30cbc5cdc2f3e1c37833b510 100644
--- a/include/core/SkTypeface.h
+++ b/include/core/SkTypeface.h
@@ -30,6 +30,12 @@ typedef uint32_t SkFontID;
/** Machine endian. */
typedef uint32_t SkFontTableTag;
+#ifdef SK_INTERNAL
+#ifndef SK_DONT_USE_LEGACY_TYPEFACE_CREATE_FROM_NAME
+#define SK_DONT_USE_LEGACY_TYPEFACE_CREATE_FROM_NAME
+#endif
+#endif
+
/** \class SkTypeface
The SkTypeface class specifies the typeface and intrinsic style of a font.
@@ -99,16 +105,21 @@ public:
*/
static SkTypeface* RefDefault(Style style = SkTypeface::kNormal);
- /** Return a new reference to the typeface that most closely matches the
- requested familyName and style. Pass null as the familyName to return
- the default font for the requested style. Will never return null
+#ifndef SK_DONT_USE_LEGACY_TYPEFACE_CREATE_FROM_NAME
+ static SkTypeface* CreateFromName(const char familyName[], Style style);
+#endif
+
+ /** Creates a new reference to the typeface that most closely matches the
+ requested familyName and fontStyle. This method allows extended font
+ face specifiers as in the SkFontStyle type. Will never return null.
@param familyName May be NULL. The name of the font family.
- @param style The style (normal, bold, italic) of the typeface.
+ @param fontStyle The style of the typeface.
@return reference to the closest-matching typeface. Call must call
unref() when they are done.
- */
- static SkTypeface* CreateFromName(const char familyName[], Style style);
+ */
+ static SkTypeface* CreateFromName(const char familyName[],
+ SkFontStyle fontStyle);
/** Return a new reference to the typeface that most closely matches the
requested typeface and specified Style. Use this call if you want to
« 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