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 |