Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Unified Diff: gm/typeface.cpp

Issue 1256903002: make fontscalar gammatext lcdtext typeface verttext2 gm portable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/lcdtext.cpp ('k') | gm/verttext2.cpp » ('j') | tools/sk_tool_utils.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/typeface.cpp
diff --git a/gm/typeface.cpp b/gm/typeface.cpp
index 5ddc338449cad4671b732ea5b52e4b110f1d7dbf..6bb6b5087905a15383c447c241e50b002b46b8cc 100644
--- a/gm/typeface.cpp
+++ b/gm/typeface.cpp
@@ -12,11 +12,9 @@
#include "SkTypes.h"
static const char* gFaces[] = {
- "Times Roman",
- "Hiragino Maru Gothic Pro",
- "Papyrus",
- "Helvetica",
- "Courier New"
+ "serif",
+ "sans-serif",
+ "monospace",
};
class TypefaceGM : public skiagm::GM {
bungeman-skia 2015/07/24 17:54:53 I think the use case for this GM is completely cov
caryclark 2015/07/24 17:59:50 Done.
@@ -38,12 +36,15 @@ protected:
void onOnceBeforeDraw() override {
fFaces = new SkTypeface*[SK_ARRAY_COUNT(gFaces)];
for (size_t i = 0; i < SK_ARRAY_COUNT(gFaces); i++) {
- fFaces[i] = sk_tool_utils::create_portable_typeface(gFaces[i], SkTypeface::kNormal);
+ fFaces[i] = SkTypeface::CreateFromName(sk_tool_utils::platform_font_name(
+ gFaces[i]), SkTypeface::kNormal);
}
}
SkString onShortName() override {
- return SkString("typeface");
+ SkString name("typeface");
+ name.append(sk_tool_utils::major_platform_os_name());
+ return name;
}
SkISize onISize() override {
@@ -177,8 +178,8 @@ public:
protected:
void onOnceBeforeDraw() override {
for (int i = 0; i < gFaceStylesCount; i++) {
- fFaces[i] = sk_tool_utils::create_portable_typeface(gFaceStyles[i].fName,
- gFaceStyles[i].fStyle);
+ fFaces[i] = SkTypeface::CreateFromName(
+ sk_tool_utils::platform_font_name(gFaceStyles[i].fName), gFaceStyles[i].fStyle);
}
}
« no previous file with comments | « gm/lcdtext.cpp ('k') | gm/verttext2.cpp » ('j') | tools/sk_tool_utils.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698