Remove SkTypeface::Style use in API.

All known callers of SkTypeface::MakeDefault call it with kNormal and
the only users specifying kNormal explicitly are in Skia, so remove the
parameter. There appear to be no users of SkTypeface::MakeFromTypeface,
so remove it. The current alternative is SkFontMgr::matchFaceStyle which
can do a better job anyway.

Change-Id: I89d94c77f9593407b0a319786848a8b823fcbae4
Reviewed-on: https://skia-review.googlesource.com/56762
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
diff --git a/include/core/SkTypeface.h b/include/core/SkTypeface.h
index 0b65ba9..5a82171 100644
--- a/include/core/SkTypeface.h
+++ b/include/core/SkTypeface.h
@@ -99,8 +99,8 @@
      */
     static bool Equal(const SkTypeface* facea, const SkTypeface* faceb);
 
-    /** Returns the default typeface, which is never nullptr. */
-    static sk_sp<SkTypeface> MakeDefault(Style style = SkTypeface::kNormal);
+    /** Returns the default normal typeface, which is never nullptr. */
+    static sk_sp<SkTypeface> MakeDefault();
 
     /** Creates a new reference to the typeface that most closely matches the
         requested familyName and fontStyle. This method allows extended font
@@ -113,16 +113,6 @@
     */
     static sk_sp<SkTypeface> MakeFromName(const char familyName[], SkFontStyle fontStyle);
 
-    /** Return the typeface that most closely matches the requested typeface and style.
-        Use this to pick a new style from the same family of the existing typeface.
-        If family is nullptr, this selects from the default font's family.
-
-        @param family  May be NULL. The name of the existing type face.
-        @param s       The style (normal, bold, italic) of the type face.
-        @return the closest-matching typeface.
-    */
-    static sk_sp<SkTypeface> MakeFromTypeface(SkTypeface* family, Style);
-
     /** Return a new typeface given a file. If the file does not exist, or is
         not a valid font file, returns nullptr.
     */
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp
index 83edea9..0c8c4b9 100644
--- a/src/core/SkTypeface.cpp
+++ b/src/core/SkTypeface.cpp
@@ -99,8 +99,8 @@
     return defaults[style].get();
 }
 
-sk_sp<SkTypeface> SkTypeface::MakeDefault(Style style) {
-    return sk_ref_sp(GetDefaultTypeface(style));
+sk_sp<SkTypeface> SkTypeface::MakeDefault() {
+    return sk_ref_sp(GetDefaultTypeface(SkTypeface::kNormal));
 }
 
 uint32_t SkTypeface::UniqueID(const SkTypeface* face) {
@@ -128,29 +128,16 @@
                             fontStyle.slant() == SkFontStyle::kUpright_Slant) &&
                            (fontStyle.weight() == SkFontStyle::kBold_Weight ||
                             fontStyle.weight() == SkFontStyle::kNormal_Weight)) {
-        return MakeDefault(static_cast<SkTypeface::Style>(
+        return sk_ref_sp(GetDefaultTypeface(static_cast<SkTypeface::Style>(
             (fontStyle.slant() == SkFontStyle::kItalic_Slant ? SkTypeface::kItalic :
                                                                SkTypeface::kNormal) |
             (fontStyle.weight() == SkFontStyle::kBold_Weight ? SkTypeface::kBold :
-                                                               SkTypeface::kNormal)));
+                                                               SkTypeface::kNormal))));
     }
     sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault());
     return fm->legacyMakeTypeface(name, fontStyle);
 }
 
-sk_sp<SkTypeface> SkTypeface::MakeFromTypeface(SkTypeface* family, Style s) {
-    if (!family) {
-        return SkTypeface::MakeDefault(s);
-    }
-
-    if (family->fontStyle() == SkFontStyle::FromOldStyle(s)) {
-        return sk_ref_sp(family);
-    }
-
-    sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault());
-    return sk_sp<SkTypeface>(fm->matchFaceStyle(family, SkFontStyle::FromOldStyle(s)));
-}
-
 sk_sp<SkTypeface> SkTypeface::MakeFromStream(SkStreamAsset* stream, int index) {
     sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault());
     return fm->makeFromStream(std::unique_ptr<SkStreamAsset>(stream), index);
diff --git a/tests/TypefaceTest.cpp b/tests/TypefaceTest.cpp
index 415d64a..6175d36 100644
--- a/tests/TypefaceTest.cpp
+++ b/tests/TypefaceTest.cpp
@@ -169,7 +169,7 @@
 DEF_TEST(Typeface, reporter) {
 
     sk_sp<SkTypeface> t1(SkTypeface::MakeFromName(nullptr, SkFontStyle()));
-    sk_sp<SkTypeface> t2(SkTypeface::MakeDefault(SkTypeface::kNormal));
+    sk_sp<SkTypeface> t2(SkTypeface::MakeDefault());
 
     REPORTER_ASSERT(reporter, SkTypeface::Equal(t1.get(), t2.get()));
     REPORTER_ASSERT(reporter, SkTypeface::Equal(nullptr, t1.get()));