SkTypeface::MakeFromName to take SkFontStyle.
SkTypeface::MakeFromName currently takes SkTypeface::Style,
which is quite limited. This starts the transition to this
function taking SkFontStyle instead.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1818043002
TBR=reed
He said it sounded like a good idea.
Review-Url: https://codereview.chromium.org/1818043002
diff --git a/tools/sk_tool_utils.cpp b/tools/sk_tool_utils.cpp
index 7343ce4..9278c84 100644
--- a/tools/sk_tool_utils.cpp
+++ b/tools/sk_tool_utils.cpp
@@ -80,7 +80,7 @@
return MakeResourceAsTypeface("/fonts/Funkster.ttf");
}
if (!strcmp(sk_tool_utils::platform_os_emoji(), "SBIX")) {
- return SkTypeface::MakeFromName("Apple Color Emoji", SkTypeface::kNormal);
+ return SkTypeface::MakeFromName("Apple Color Emoji", SkFontStyle());
}
return nullptr;
}
@@ -156,11 +156,11 @@
return SkPixel16ToColor(color16);
}
-sk_sp<SkTypeface> create_portable_typeface(const char* name, SkTypeface::Style style) {
+sk_sp<SkTypeface> create_portable_typeface(const char* name, SkFontStyle style) {
return create_font(name, style);
}
-void set_portable_typeface(SkPaint* paint, const char* name, SkTypeface::Style style) {
+void set_portable_typeface(SkPaint* paint, const char* name, SkFontStyle style) {
paint->setTypeface(create_font(name, style));
}