aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2017-07-27 10:45:29 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-27 21:30:45 +0000
commit713195071dc7bdeddec2d1c9fab9b3720f049f07 (patch)
tree1bc2d47ec9e66f81a14d626eb5ad8185dbecca27 /tools
parent23890a9ac89005a15967fe8af8aaafc0edda5e32 (diff)
Remove internal use of SkTypeface::Style.
Change-Id: I71cf04b12be95a54b7fb47d048ba1f8672ed9a8f Reviewed-on: https://skia-review.googlesource.com/27760 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/create_test_font.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/tools/create_test_font.cpp b/tools/create_test_font.cpp
index 721e16b567..4fd8dbbdbb 100644
--- a/tools/create_test_font.cpp
+++ b/tools/create_test_font.cpp
@@ -9,6 +9,7 @@
// and ./tools/test_font_<generic name>.inc which are read by ./tools/sk_tool_utils_font.cpp
#include "Resources.h"
+#include "SkFontStyle.h"
#include "SkOSFile.h"
#include "SkOSPath.h"
#include "SkPaint.h"
@@ -28,16 +29,17 @@ struct NamedFontStyle {
const char* fName;
SkFontStyle fStyle;
};
-NamedFontStyle normal = {"Normal", SkFontStyle(SkFontStyle::kNormal_Weight, SkFontStyle::kNormal_Width, SkFontStyle::kUpright_Slant)};
-NamedFontStyle bold = {"Bold", SkFontStyle(SkFontStyle::kBold_Weight, SkFontStyle::kNormal_Width, SkFontStyle::kUpright_Slant)};
-NamedFontStyle italic = {"Italic", SkFontStyle(SkFontStyle::kNormal_Weight, SkFontStyle::kNormal_Width, SkFontStyle::kItalic_Slant )};
-NamedFontStyle bolditalic = {"BoldItalic", SkFontStyle(SkFontStyle::kBold_Weight, SkFontStyle::kNormal_Width, SkFontStyle::kItalic_Slant )};
+constexpr NamedFontStyle normal = {"Normal", SkFontStyle::Normal() };
+constexpr NamedFontStyle bold = {"Bold", SkFontStyle::Bold() };
+constexpr NamedFontStyle italic = {"Italic", SkFontStyle::Italic() };
+constexpr NamedFontStyle bolditalic = {"BoldItalic", SkFontStyle::BoldItalic()};
struct FontDesc {
- const char* fGenericName;
- NamedFontStyle fNamedStyle;
- const char* fFontName;
- const char* fFile;
+ char const * const fGenericName;
+ NamedFontStyle const fNamedStyle;
+ char const * const fFontName;
+ char const * const fFile;
+ // fFontIndex is mutable and will be set later.
int fFontIndex;
} gFonts[] = {
{"monospace", normal, "Liberation Mono", "LiberationMono-Regular.ttf", -1},