aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/sk_tool_utils.cpp
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-11-14 10:45:32 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-14 18:45:04 +0000
commitcb9fc4160ea95453cb37134d4477c63d512458cc (patch)
tree9f8ae3cf1448b1aadf0490a6de225a7256cc1d33 /tools/sk_tool_utils.cpp
parent9592817042c411accbfa37ad736b139f9af9c976 (diff)
remove platform_font_name()
It's used rarely and now that we're mostly using portable fonts, it only serves to confuse. Sans-serif doesn't seem to work anyway. Simplify gm/typeface.cpp to just test the default typeface. Change-Id: I091239ea91af9d9e01d3c76280636a6061b5fb5c Reviewed-on: https://skia-review.googlesource.com/71261 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'tools/sk_tool_utils.cpp')
-rw-r--r--tools/sk_tool_utils.cpp45
1 files changed, 0 insertions, 45 deletions
diff --git a/tools/sk_tool_utils.cpp b/tools/sk_tool_utils.cpp
index d2063dfd88..b23676fc94 100644
--- a/tools/sk_tool_utils.cpp
+++ b/tools/sk_tool_utils.cpp
@@ -22,16 +22,6 @@
namespace sk_tool_utils {
-/* these are the default fonts chosen by Chrome for serif, sans-serif, and monospace */
-static const char* gStandardFontNames[][3] = {
- { "Times", "Helvetica", "Courier" }, // Mac
- { "Times New Roman", "Helvetica", "Courier" }, // iOS
- { "Times New Roman", "Arial", "Courier New" }, // Win
- { "Times New Roman", "Arial", "Monospace" }, // Ubuntu
- { "serif", "sans-serif", "monospace" }, // Android
- { "Tinos", "Arimo", "Cousine" } // ChromeOS
-};
-
static bool starts_with(const char* str, const char* prefix) {
return 0 == strncmp(str, prefix, strlen(prefix));
}
@@ -45,41 +35,6 @@ static const char* platform_os_name() {
return "";
}
-const char* platform_font_name(const char* name) {
- int index;
- if (!strcmp(name, "serif")) {
- index = 0;
- } else if (!strcmp(name, "san-serif")) {
- index = 1;
- } else if (!strcmp(name, "monospace")) {
- index = 2;
- } else {
- return name;
- }
-
- const char* platform = platform_os_name();
-
- if (starts_with(platform, "Mac")) {
- return gStandardFontNames[0][index];
- }
- if (starts_with(platform, "iOS")) {
- return gStandardFontNames[1][index];
- }
- if (starts_with(platform, "Win")) {
- return gStandardFontNames[2][index];
- }
- if (starts_with(platform, "Ubuntu") || starts_with(platform, "Debian")) {
- return gStandardFontNames[3][index];
- }
- if (starts_with(platform, "Android")) {
- return gStandardFontNames[4][index];
- }
- if (starts_with(platform, "ChromeOS")) {
- return gStandardFontNames[5][index];
- }
- return name;
-}
-
const char* platform_os_emoji() {
const char* osName = platform_os_name();
if (starts_with(osName, "Android") ||