rename portable_typeface_always to portable_typeface
TBR=reed@google.com
Review URL: https://codereview.chromium.org/1257773002
diff --git a/bench/TextBlobBench.cpp b/bench/TextBlobBench.cpp
index f830001..d110b8d 100644
--- a/bench/TextBlobBench.cpp
+++ b/bench/TextBlobBench.cpp
@@ -30,7 +30,7 @@
protected:
void onPreDraw() override {
- fTypeface.reset(sk_tool_utils::create_portable_typeface("Times", SkTypeface::kNormal));
+ fTypeface.reset(sk_tool_utils::create_portable_typeface("serif", SkTypeface::kNormal));
// make textblob
SkPaint paint;
paint.setTypeface(fTypeface);
diff --git a/dm/DM.cpp b/dm/DM.cpp
index d472be6..c488bca 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -757,7 +757,7 @@
static SkTypeface* create_from_name(const char familyName[], SkTypeface::Style style) {
if (familyName && strlen(familyName) > sizeof(PORTABLE_FONT_PREFIX)
&& !strncmp(familyName, PORTABLE_FONT_PREFIX, sizeof(PORTABLE_FONT_PREFIX) - 1)) {
- return sk_tool_utils::create_portable_typeface_always(familyName, style);
+ return sk_tool_utils::create_portable_typeface(familyName, style);
}
return NULL;
}
diff --git a/gm/aaxfermodes.cpp b/gm/aaxfermodes.cpp
index 378f2bb..8e66b43 100644
--- a/gm/aaxfermodes.cpp
+++ b/gm/aaxfermodes.cpp
@@ -68,7 +68,7 @@
void onOnceBeforeDraw() override {
fLabelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&fLabelPaint);
+ sk_tool_utils::set_portable_typeface(&fLabelPaint);
fLabelPaint.setTextSize(5 * kShapeSize/8);
fLabelPaint.setSubpixelText(true);
diff --git a/gm/all_bitmap_configs.cpp b/gm/all_bitmap_configs.cpp
index a0a8f67..7ff8675 100644
--- a/gm/all_bitmap_configs.cpp
+++ b/gm/all_bitmap_configs.cpp
@@ -75,7 +75,7 @@
const SkScalar D = 0.3f * SkIntToScalar(SCALE);
const SkScalar X = SkDoubleToScalar(D * sqrt_3_over_2);
const SkScalar Y = D * SK_ScalarHalf;
- sk_tool_utils::set_portable_typeface_always(&p, NULL, SkTypeface::kBold);
+ sk_tool_utils::set_portable_typeface(&p, NULL, SkTypeface::kBold);
p.setTextSize(0.28125f * SCALE);
draw_center_letter('K', &p, SK_ColorBLACK, Z, Z, canvas);
draw_center_letter('R', &p, SK_ColorRED, Z, D, canvas);
@@ -156,7 +156,7 @@
SkPaint p;
p.setColor(SK_ColorBLACK);
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&p, NULL);
+ sk_tool_utils::set_portable_typeface(&p, NULL);
sk_tool_utils::draw_checkerboard(canvas, SK_ColorLTGRAY, SK_ColorWHITE, 8);
diff --git a/gm/arithmode.cpp b/gm/arithmode.cpp
index c58b14e..4b81944 100644
--- a/gm/arithmode.cpp
+++ b/gm/arithmode.cpp
@@ -58,7 +58,7 @@
SkPaint paint;
paint.setTextSize(SkIntToScalar(24));
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
for (int i = 0; i < 4; ++i) {
SkString str;
str.appendScalar(k[i]);
diff --git a/gm/bigtext.cpp b/gm/bigtext.cpp
index 8a1faa1..c69d9b9 100644
--- a/gm/bigtext.cpp
+++ b/gm/bigtext.cpp
@@ -31,7 +31,7 @@
void onDraw(SkCanvas* canvas) override {
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(1500);
SkRect r;
diff --git a/gm/bitmapcopy.cpp b/gm/bitmapcopy.cpp
index e1268b7..ac43db5 100644
--- a/gm/bitmapcopy.cpp
+++ b/gm/bitmapcopy.cpp
@@ -77,7 +77,7 @@
canvas->clear(sk_tool_utils::color_to_565(0xFFDDDDDD));
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
SkScalar width = SkIntToScalar(40);
SkScalar height = SkIntToScalar(40);
diff --git a/gm/bitmapfilters.cpp b/gm/bitmapfilters.cpp
index 11f93c9..aeb88d6 100644
--- a/gm/bitmapfilters.cpp
+++ b/gm/bitmapfilters.cpp
@@ -53,7 +53,7 @@
const int scale = 32;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
const char* name = sk_tool_utils::colortype_name(bm.colorType());
canvas->drawText(name, strlen(name), x, SkIntToScalar(bm.height())*scale*5/8,
paint);
diff --git a/gm/bitmapsource.cpp b/gm/bitmapsource.cpp
index 33752a2..a0a3eca 100644
--- a/gm/bitmapsource.cpp
+++ b/gm/bitmapsource.cpp
@@ -27,7 +27,7 @@
canvas.clear(0x00000000);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(0xFFFFFFFF);
paint.setTextSize(SkIntToScalar(96));
const char* str = "e";
diff --git a/gm/blurs.cpp b/gm/blurs.cpp
index e7b66d5..b1af685 100644
--- a/gm/blurs.cpp
+++ b/gm/blurs.cpp
@@ -40,7 +40,7 @@
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(25));
canvas->translate(SkIntToScalar(-40), SkIntToScalar(0));
diff --git a/gm/bmpfilterqualityrepeat.cpp b/gm/bmpfilterqualityrepeat.cpp
index edcd696..5c19f00 100644
--- a/gm/bmpfilterqualityrepeat.cpp
+++ b/gm/bmpfilterqualityrepeat.cpp
@@ -51,7 +51,7 @@
for (size_t q = 0; q < SK_ARRAY_COUNT(kQualities); ++q) {
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setFilterQuality(kQualities[q].fQuality);
SkPaint bmpPaint(paint);
SkMatrix lm = SkMatrix::I();
diff --git a/gm/colortype.cpp b/gm/colortype.cpp
index e2c4592..8e69664 100644
--- a/gm/colortype.cpp
+++ b/gm/colortype.cpp
@@ -35,7 +35,7 @@
paint.setAntiAlias(true);
paint.setShader(s)->unref();
- SkTypeface* orig = sk_tool_utils::create_portable_typeface_always("serif",
+ SkTypeface* orig = sk_tool_utils::create_portable_typeface("serif",
SkTypeface::kBold);
if (NULL == orig) {
orig = SkTypeface::RefDefault();
diff --git a/gm/colortypexfermode.cpp b/gm/colortypexfermode.cpp
index 7d54011..97becde 100644
--- a/gm/colortypexfermode.cpp
+++ b/gm/colortypexfermode.cpp
@@ -42,7 +42,7 @@
paint.setAntiAlias(true);
paint.setShader(s)->unref();
- SkTypeface* orig = sk_tool_utils::create_portable_typeface_always("serif",
+ SkTypeface* orig = sk_tool_utils::create_portable_typeface("serif",
SkTypeface::kBold);
if (NULL == orig) {
orig = SkTypeface::RefDefault();
@@ -112,7 +112,7 @@
SkPaint labelP;
labelP.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelP);
+ sk_tool_utils::set_portable_typeface(&labelP);
labelP.setTextAlign(SkPaint::kCenter_Align);
SkPaint textP;
diff --git a/gm/colorwheel.cpp b/gm/colorwheel.cpp
index f4542b3..9af52f2 100644
--- a/gm/colorwheel.cpp
+++ b/gm/colorwheel.cpp
@@ -39,7 +39,7 @@
DEF_SIMPLE_GM(colorwheelnative, canvas, 128, 28) {
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint, NULL, SkTypeface::kBold);
+ sk_tool_utils::set_portable_typeface(&paint, NULL, SkTypeface::kBold);
paint.setTextSize(18.0f);
canvas->clear(sk_tool_utils::color_to_565(SK_ColorLTGRAY));
diff --git a/gm/complexclip.cpp b/gm/complexclip.cpp
index 038b142..ba44aa0 100644
--- a/gm/complexclip.cpp
+++ b/gm/complexclip.cpp
@@ -83,7 +83,7 @@
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(20));
static const struct {
diff --git a/gm/complexclip3.cpp b/gm/complexclip3.cpp
index 7c22d71..ae07d8e 100644
--- a/gm/complexclip3.cpp
+++ b/gm/complexclip3.cpp
@@ -49,7 +49,7 @@
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(20));
static const struct {
diff --git a/gm/constcolorprocessor.cpp b/gm/constcolorprocessor.cpp
index e763305..26898be 100644
--- a/gm/constcolorprocessor.cpp
+++ b/gm/constcolorprocessor.cpp
@@ -123,7 +123,7 @@
// Draw labels for the input to the processor and the processor to the right of
// the test rect. The input label appears above the processor label.
SkPaint labelPaint;
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setAntiAlias(true);
labelPaint.setTextSize(10.f);
SkString inputLabel;
diff --git a/gm/convexpolyclip.cpp b/gm/convexpolyclip.cpp
index c1df69e..0478b51 100644
--- a/gm/convexpolyclip.cpp
+++ b/gm/convexpolyclip.cpp
@@ -56,7 +56,7 @@
}
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(wScalar / 2.2f);
paint.setShader(0);
paint.setColor(sk_tool_utils::color_to_565(SK_ColorLTGRAY));
@@ -150,7 +150,7 @@
SkPaint txtPaint;
txtPaint.setTextSize(23.f);
txtPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&txtPaint);
+ sk_tool_utils::set_portable_typeface(&txtPaint);
txtPaint.setColor(sk_tool_utils::color_to_565(SK_ColorDKGRAY));
SkScalar textW = txtPaint.measureText(kTxt, SK_ARRAY_COUNT(kTxt)-1);
diff --git a/gm/cubicpaths.cpp b/gm/cubicpaths.cpp
index c8230fc..b3fca5a 100644
--- a/gm/cubicpaths.cpp
+++ b/gm/cubicpaths.cpp
@@ -124,7 +124,7 @@
SkPaint titlePaint;
titlePaint.setColor(SK_ColorBLACK);
titlePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&titlePaint);
+ sk_tool_utils::set_portable_typeface(&titlePaint);
titlePaint.setTextSize(15 * SK_Scalar1);
const char title[] = "Cubic Drawn Into Rectangle Clips With "
"Indicated Style, Fill and Linecaps, with stroke width 10";
@@ -168,7 +168,7 @@
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(10 * SK_Scalar1);
canvas->drawText(gStyles[style].fName,
strlen(gStyles[style].fName),
@@ -269,7 +269,7 @@
SkPaint titlePaint;
titlePaint.setColor(SK_ColorBLACK);
titlePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&titlePaint);
+ sk_tool_utils::set_portable_typeface(&titlePaint);
titlePaint.setTextSize(15 * SK_Scalar1);
const char title[] = "Cubic Closed Drawn Into Rectangle Clips With "
"Indicated Style, Fill and Linecaps, with stroke width 10";
@@ -313,7 +313,7 @@
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(10 * SK_Scalar1);
canvas->drawText(gStyles[style].fName,
strlen(gStyles[style].fName),
diff --git a/gm/dcshader.cpp b/gm/dcshader.cpp
index c60c28a..ce73662 100644
--- a/gm/dcshader.cpp
+++ b/gm/dcshader.cpp
@@ -206,7 +206,7 @@
}
virtual void setFont(SkPaint* paint) {
- sk_tool_utils::set_portable_typeface_always(paint);
+ sk_tool_utils::set_portable_typeface(paint);
}
virtual const char* text() const { return "Hello, Skia!"; }
diff --git a/gm/degeneratesegments.cpp b/gm/degeneratesegments.cpp
index 4016e45..df111ac 100644
--- a/gm/degeneratesegments.cpp
+++ b/gm/degeneratesegments.cpp
@@ -287,7 +287,7 @@
SkPaint titlePaint;
titlePaint.setColor(SK_ColorBLACK);
titlePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&titlePaint);
+ sk_tool_utils::set_portable_typeface(&titlePaint);
titlePaint.setTextSize(15 * SK_Scalar1);
const char title[] = "Random Paths Drawn Into Rectangle Clips With "
"Indicated Style, Fill and Linecaps, "
@@ -347,7 +347,7 @@
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(10 * SK_Scalar1);
canvas->drawText(style.fName,
strlen(style.fName),
diff --git a/gm/dftext.cpp b/gm/dftext.cpp
index 3753283..0b68add 100755
--- a/gm/dftext.cpp
+++ b/gm/dftext.cpp
@@ -67,7 +67,7 @@
paint.setAntiAlias(true);
paint.setSubpixelText(true);
- sk_tool_utils::set_portable_typeface_always(&paint, "serif", SkTypeface::kNormal);
+ sk_tool_utils::set_portable_typeface(&paint, "serif", SkTypeface::kNormal);
const char* text = "Hamburgefons";
const size_t textLen = strlen(text);
diff --git a/gm/displacement.cpp b/gm/displacement.cpp
index 129682d..4450fe2 100644
--- a/gm/displacement.cpp
+++ b/gm/displacement.cpp
@@ -38,7 +38,7 @@
canvas.clear(0x00000000);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(sk_tool_utils::color_to_565(0xFF884422));
paint.setTextSize(SkIntToScalar(96));
const char* str = "g";
diff --git a/gm/downsamplebitmap.cpp b/gm/downsamplebitmap.cpp
index bb47368..4aceef9 100644
--- a/gm/downsamplebitmap.cpp
+++ b/gm/downsamplebitmap.cpp
@@ -31,7 +31,7 @@
}
static void setTypeface(SkPaint* paint, const char name[], SkTypeface::Style style) {
- sk_tool_utils::set_portable_typeface_always(paint, name, style);
+ sk_tool_utils::set_portable_typeface(paint, name, style);
}
class DownsampleBitmapGM : public skiagm::GM {
diff --git a/gm/drawatlascolor.cpp b/gm/drawatlascolor.cpp
index ad0ec50..a04822f 100644
--- a/gm/drawatlascolor.cpp
+++ b/gm/drawatlascolor.cpp
@@ -138,7 +138,7 @@
SkPaint textP;
textP.setTextSize(SkIntToScalar(kTextPad));
textP.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&textP, NULL);
+ sk_tool_utils::set_portable_typeface(&textP, NULL);
for (int i = 0; i < numModes; ++i) {
canvas->drawText(gModes[i].fLabel, strlen(gModes[i].fLabel),
diff --git a/gm/drawbitmaprect.cpp b/gm/drawbitmaprect.cpp
index d7b5a9b..9db5ca7 100644
--- a/gm/drawbitmaprect.cpp
+++ b/gm/drawbitmaprect.cpp
@@ -163,7 +163,7 @@
blackPaint.setColor(SK_ColorBLACK);
blackPaint.setTextSize(titleHeight);
blackPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&blackPaint);
+ sk_tool_utils::set_portable_typeface(&blackPaint);
SkString title;
title.printf("Bitmap size: %d x %d", gBmpSize, gBmpSize);
canvas->drawText(title.c_str(), title.size(), 0,
diff --git a/gm/drawlooper.cpp b/gm/drawlooper.cpp
index 74e7e91..624358f 100644
--- a/gm/drawlooper.cpp
+++ b/gm/drawlooper.cpp
@@ -40,7 +40,7 @@
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(72));
paint.setLooper(fLooper);
diff --git a/gm/dropshadowimagefilter.cpp b/gm/dropshadowimagefilter.cpp
index fd5f583..e06264c 100644
--- a/gm/dropshadowimagefilter.cpp
+++ b/gm/dropshadowimagefilter.cpp
@@ -39,7 +39,7 @@
paint.setImageFilter(imf);
paint.setColor(SK_ColorGREEN);
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(r.height()/2);
paint.setTextAlign(SkPaint::kCenter_Align);
canvas->save();
diff --git a/gm/emptypath.cpp b/gm/emptypath.cpp
index 64eb286..ec60bfc 100644
--- a/gm/emptypath.cpp
+++ b/gm/emptypath.cpp
@@ -63,7 +63,7 @@
SkPaint titlePaint;
titlePaint.setColor(SK_ColorBLACK);
titlePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&titlePaint);
+ sk_tool_utils::set_portable_typeface(&titlePaint);
titlePaint.setTextSize(15 * SK_Scalar1);
const char title[] = "Empty Paths Drawn Into Rectangle Clips With "
"Indicated Style and Fill";
@@ -106,7 +106,7 @@
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(12 * SK_Scalar1);
canvas->drawText(gStyles[style].fName,
strlen(gStyles[style].fName),
diff --git a/gm/filterbitmap.cpp b/gm/filterbitmap.cpp
index d7194c0..46500ba 100644
--- a/gm/filterbitmap.cpp
+++ b/gm/filterbitmap.cpp
@@ -14,7 +14,7 @@
#include "SkTypeface.h"
static void setTypeface(SkPaint* paint, const char name[], SkTypeface::Style style) {
- sk_tool_utils::set_portable_typeface_always(paint, name, style);
+ sk_tool_utils::set_portable_typeface(paint, name, style);
}
static SkSize computeSize(const SkBitmap& bm, const SkMatrix& mat) {
diff --git a/gm/fontcache.cpp b/gm/fontcache.cpp
index eb841b0..5f1141e 100644
--- a/gm/fontcache.cpp
+++ b/gm/fontcache.cpp
@@ -40,8 +40,8 @@
}
void onOnceBeforeDraw() override {
- fTypefaces[0] = sk_tool_utils::create_portable_typeface_always("serif", SkTypeface::kItalic);
- fTypefaces[1] = sk_tool_utils::create_portable_typeface_always("sans-serif", SkTypeface::kItalic);
+ fTypefaces[0] = sk_tool_utils::create_portable_typeface("serif", SkTypeface::kItalic);
+ fTypefaces[1] = sk_tool_utils::create_portable_typeface("sans-serif", SkTypeface::kItalic);
}
void onDraw(SkCanvas* canvas) override {
diff --git a/gm/gammatext.cpp b/gm/gammatext.cpp
index b6d4ea2..a46f828 100644
--- a/gm/gammatext.cpp
+++ b/gm/gammatext.cpp
@@ -20,7 +20,7 @@
}
static bool setFont(SkPaint* paint, const char name[]) {
- SkTypeface* tf = sk_tool_utils::create_portable_typeface(name, SkTypeface::kNormal);
+ SkTypeface* tf = SkTypeface::CreateFromName(name, SkTypeface::kNormal);
if (tf) {
paint->setTypeface(tf)->unref();
return true;
diff --git a/gm/getpostextpath.cpp b/gm/getpostextpath.cpp
index bb641a0..2286602 100644
--- a/gm/getpostextpath.cpp
+++ b/gm/getpostextpath.cpp
@@ -39,7 +39,7 @@
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(48));
canvas->translate(SkIntToScalar(10), SkIntToScalar(64));
diff --git a/gm/glyph_pos.cpp b/gm/glyph_pos.cpp
index 90329ed..e57f5c6 100644
--- a/gm/glyph_pos.cpp
+++ b/gm/glyph_pos.cpp
@@ -105,7 +105,7 @@
paint.setColor(SK_ColorBLACK);
paint.setAntiAlias(true);
paint.setTextSize(kTextHeight * textScale);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setStrokeWidth(fStrokeWidth);
paint.setStyle(fStrokeStyle);
diff --git a/gm/gradtext.cpp b/gm/gradtext.cpp
index 0f1a1bf..b576ede 100644
--- a/gm/gradtext.cpp
+++ b/gm/gradtext.cpp
@@ -47,7 +47,7 @@
virtual SkISize onISize() { return SkISize::Make(500, 480); }
virtual void onDraw(SkCanvas* canvas) {
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
SkRect r = SkRect::MakeWH(SkIntToScalar(100), SkIntToScalar(100));
canvas->clipRect(r);
@@ -76,7 +76,7 @@
virtual SkISize onISize() { return SkISize::Make(500, 480); }
virtual void onDraw(SkCanvas* canvas) {
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setStyle(SkPaint::kFill_Style);
canvas->drawText("Normal Fill Text", 16, 0, 50, paint);
@@ -129,7 +129,7 @@
void onDraw(SkCanvas* canvas) override {
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(26));
const SkISize& size = this->getISize();
diff --git a/gm/image.cpp b/gm/image.cpp
index 68bcd7a..5e840fb 100644
--- a/gm/image.cpp
+++ b/gm/image.cpp
@@ -149,7 +149,7 @@
SkPaint textPaint;
textPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&textPaint);
+ sk_tool_utils::set_portable_typeface(&textPaint);
textPaint.setTextSize(8);
canvas->drawText(kLabel1, strlen(kLabel1), 10, 60, textPaint);
diff --git a/gm/imageblur.cpp b/gm/imageblur.cpp
index d0f1fd1..efb5988 100644
--- a/gm/imageblur.cpp
+++ b/gm/imageblur.cpp
@@ -41,7 +41,7 @@
SkRandom rand;
SkPaint textPaint;
textPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&textPaint);
+ sk_tool_utils::set_portable_typeface(&textPaint);
for (int i = 0; i < 25; ++i) {
int x = rand.nextULessThan(WIDTH);
int y = rand.nextULessThan(HEIGHT);
diff --git a/gm/imageblurtiled.cpp b/gm/imageblurtiled.cpp
index 5b00b17..ed4ae6c 100644
--- a/gm/imageblurtiled.cpp
+++ b/gm/imageblurtiled.cpp
@@ -50,7 +50,7 @@
};
SkPaint textPaint;
textPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&textPaint);
+ sk_tool_utils::set_portable_typeface(&textPaint);
textPaint.setTextSize(SkIntToScalar(100));
int posY = 0;
for (unsigned i = 0; i < SK_ARRAY_COUNT(str); i++) {
diff --git a/gm/imagefiltersbase.cpp b/gm/imagefiltersbase.cpp
index 993e654..426a4dc 100644
--- a/gm/imagefiltersbase.cpp
+++ b/gm/imagefiltersbase.cpp
@@ -145,7 +145,7 @@
paint.setImageFilter(imf);
paint.setColor(SK_ColorCYAN);
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(r.height()/2);
paint.setTextAlign(SkPaint::kCenter_Align);
canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint);
@@ -283,7 +283,7 @@
SkPaint::kAntiAlias_Flag | SkPaint::kLCDRenderText_Flag,
};
SkPaint paint(origPaint);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(30);
SkAutoCanvasRestore acr(canvas, true);
diff --git a/gm/imagefilterscropped.cpp b/gm/imagefilterscropped.cpp
index f06da0e..929f2fe 100644
--- a/gm/imagefilterscropped.cpp
+++ b/gm/imagefilterscropped.cpp
@@ -44,7 +44,7 @@
paint.setImageFilter(imf);
paint.setColor(SK_ColorGREEN);
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(r.height()/2);
paint.setTextAlign(SkPaint::kCenter_Align);
canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint);
diff --git a/gm/imagefiltersgraph.cpp b/gm/imagefiltersgraph.cpp
index fb3d79f..cfedaf0 100644
--- a/gm/imagefiltersgraph.cpp
+++ b/gm/imagefiltersgraph.cpp
@@ -113,7 +113,7 @@
canvas.clear(SK_ColorTRANSPARENT);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(SK_ColorWHITE);
paint.setTextSize(SkIntToScalar(96));
const char* str = "e";
diff --git a/gm/imagemagnifier.cpp b/gm/imagemagnifier.cpp
index 2e739cf..ac1941c 100644
--- a/gm/imagemagnifier.cpp
+++ b/gm/imagemagnifier.cpp
@@ -45,7 +45,7 @@
int x = rand.nextULessThan(WIDTH);
int y = rand.nextULessThan(HEIGHT);
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(sk_tool_utils::color_to_565(rand.nextBits(24) | 0xFF000000));
paint.setTextSize(rand.nextRangeScalar(0, 300));
paint.setAntiAlias(true);
diff --git a/gm/imageresizetiled.cpp b/gm/imageresizetiled.cpp
index 724f950..bc640bc 100644
--- a/gm/imageresizetiled.cpp
+++ b/gm/imageresizetiled.cpp
@@ -56,7 +56,7 @@
};
SkPaint textPaint;
textPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&textPaint);
+ sk_tool_utils::set_portable_typeface(&textPaint);
textPaint.setTextSize(SkIntToScalar(100));
int posY = 0;
for (unsigned i = 0; i < SK_ARRAY_COUNT(str); i++) {
diff --git a/gm/internal_links.cpp b/gm/internal_links.cpp
index e422868..bb5447e 100644
--- a/gm/internal_links.cpp
+++ b/gm/internal_links.cpp
@@ -61,7 +61,7 @@
canvas->drawRect(rect, paint);
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(25));
paint.setColor(SK_ColorBLACK);
canvas->drawText(text, strlen(text), x, y, paint);
diff --git a/gm/largeglyphblur.cpp b/gm/largeglyphblur.cpp
index 9d9ff41..8723824 100644
--- a/gm/largeglyphblur.cpp
+++ b/gm/largeglyphblur.cpp
@@ -32,7 +32,7 @@
const char text[] = "Hamburgefons";
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(256);
paint.setAntiAlias(true);
diff --git a/gm/lighting.cpp b/gm/lighting.cpp
index 345e11e..6df5851 100644
--- a/gm/lighting.cpp
+++ b/gm/lighting.cpp
@@ -33,7 +33,7 @@
canvas.clear(0x00000000);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(0xFFFFFFFF);
paint.setTextSize(SkIntToScalar(96));
const char* str = "e";
diff --git a/gm/linepaths.cpp b/gm/linepaths.cpp
index 2f5c692..e8a4b0b 100644
--- a/gm/linepaths.cpp
+++ b/gm/linepaths.cpp
@@ -82,7 +82,7 @@
SkPaint titlePaint;
titlePaint.setColor(SK_ColorBLACK);
titlePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&titlePaint);
+ sk_tool_utils::set_portable_typeface(&titlePaint);
titlePaint.setTextSize(15 * SK_Scalar1);
const char title[] = "Line Drawn Into Rectangle Clips With "
"Indicated Style, Fill and Linecaps, with stroke width 10";
@@ -126,7 +126,7 @@
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(10 * SK_Scalar1);
canvas->drawText(gStyles[style].fName,
strlen(gStyles[style].fName),
@@ -224,7 +224,7 @@
SkPaint titlePaint;
titlePaint.setColor(SK_ColorBLACK);
titlePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&titlePaint);
+ sk_tool_utils::set_portable_typeface(&titlePaint);
titlePaint.setTextSize(15 * SK_Scalar1);
const char title[] = "Line Closed Drawn Into Rectangle Clips With "
"Indicated Style, Fill and Linecaps, with stroke width 10";
@@ -268,7 +268,7 @@
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(10 * SK_Scalar1);
canvas->drawText(gStyles[style].fName,
strlen(gStyles[style].fName),
diff --git a/gm/lumafilter.cpp b/gm/lumafilter.cpp
index 12c2f95..1423788 100644
--- a/gm/lumafilter.cpp
+++ b/gm/lumafilter.cpp
@@ -18,7 +18,7 @@
static void draw_label(SkCanvas* canvas, const char* label,
const SkPoint& offset) {
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
size_t len = strlen(label);
SkScalar width = paint.measureText(label, len);
diff --git a/gm/matrixconvolution.cpp b/gm/matrixconvolution.cpp
index 06684e4..b912f90 100644
--- a/gm/matrixconvolution.cpp
+++ b/gm/matrixconvolution.cpp
@@ -30,7 +30,7 @@
canvas.clear(0x00000000);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(0xFFFFFFFF);
paint.setTextSize(SkIntToScalar(180));
SkPoint pts[2] = { SkPoint::Make(0, 0),
diff --git a/gm/mixedtextblobs.cpp b/gm/mixedtextblobs.cpp
index 681b0b7..32ebdec 100644
--- a/gm/mixedtextblobs.cpp
+++ b/gm/mixedtextblobs.cpp
@@ -50,7 +50,7 @@
SkPaint paint;
paint.setTextSize(385);
const char* text = "O";
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
SkRect bounds;
paint.measureText(text, strlen(text), &bounds);
diff --git a/gm/morphology.cpp b/gm/morphology.cpp
index e12c8fb..cb321c6 100644
--- a/gm/morphology.cpp
+++ b/gm/morphology.cpp
@@ -31,7 +31,7 @@
canvas.clear(0x0);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
const char* str1 = "ABC";
const char* str2 = "XYZ";
paint.setColor(0xFFFFFFFF);
diff --git a/gm/offsetimagefilter.cpp b/gm/offsetimagefilter.cpp
index 0891ae5..35ccc05 100644
--- a/gm/offsetimagefilter.cpp
+++ b/gm/offsetimagefilter.cpp
@@ -31,7 +31,7 @@
canvas.clear(0);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(sk_tool_utils::color_to_565(0xD000D000));
paint.setTextSize(96);
canvas.drawText("e", 1, 15, 65, paint);
diff --git a/gm/pictureimagefilter.cpp b/gm/pictureimagefilter.cpp
index a951cb4..fd8ae62 100644
--- a/gm/pictureimagefilter.cpp
+++ b/gm/pictureimagefilter.cpp
@@ -28,7 +28,7 @@
canvas->clear(SK_ColorBLACK);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(0xFFFFFFFF);
paint.setTextSize(SkIntToScalar(96));
const char* str = "e";
diff --git a/gm/poly2poly.cpp b/gm/poly2poly.cpp
index 4ab8209..72ab727 100644
--- a/gm/poly2poly.cpp
+++ b/gm/poly2poly.cpp
@@ -37,7 +37,7 @@
SkJSCanvas::SkJSCanvas(SkCanvas* target) : fTarget(target) {
fFillPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&fFillPaint);
+ sk_tool_utils::set_portable_typeface(&fFillPaint);
fStrokePaint.setAntiAlias(true);
fStrokePaint.setStyle(SkPaint::kStroke_Style);
fStrokePaint.setStrokeWidth(SK_Scalar1);
@@ -227,7 +227,7 @@
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setStrokeWidth(SkIntToScalar(4));
paint.setTextSize(SkIntToScalar(40));
paint.setTextAlign(SkPaint::kCenter_Align);
diff --git a/gm/quadpaths.cpp b/gm/quadpaths.cpp
index 5e4b7a4..2fab37b 100644
--- a/gm/quadpaths.cpp
+++ b/gm/quadpaths.cpp
@@ -83,7 +83,7 @@
SkPaint titlePaint;
titlePaint.setColor(SK_ColorBLACK);
titlePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&titlePaint);
+ sk_tool_utils::set_portable_typeface(&titlePaint);
titlePaint.setTextSize(15 * SK_Scalar1);
const char title[] = "Quad Drawn Into Rectangle Clips With "
"Indicated Style, Fill and Linecaps, with stroke width 10";
@@ -127,7 +127,7 @@
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(10 * SK_Scalar1);
canvas->drawText(gStyles[style].fName,
strlen(gStyles[style].fName),
@@ -227,7 +227,7 @@
SkPaint titlePaint;
titlePaint.setColor(SK_ColorBLACK);
titlePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&titlePaint);
+ sk_tool_utils::set_portable_typeface(&titlePaint);
titlePaint.setTextSize(15 * SK_Scalar1);
const char title[] = "Quad Closed Drawn Into Rectangle Clips With "
"Indicated Style, Fill and Linecaps, with stroke width 10";
@@ -271,7 +271,7 @@
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(10 * SK_Scalar1);
canvas->drawText(gStyles[style].fName,
strlen(gStyles[style].fName),
diff --git a/gm/shadertext.cpp b/gm/shadertext.cpp
index 599cff3..2bb4e96 100644
--- a/gm/shadertext.cpp
+++ b/gm/shadertext.cpp
@@ -144,7 +144,7 @@
SkPaint paint;
paint.setDither(true);
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(pointSize));
canvas->save();
diff --git a/gm/shadertext2.cpp b/gm/shadertext2.cpp
index cd996b3..4d697d9 100644
--- a/gm/shadertext2.cpp
+++ b/gm/shadertext2.cpp
@@ -90,13 +90,13 @@
SkPaint fillPaint;
fillPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&fillPaint);
+ sk_tool_utils::set_portable_typeface(&fillPaint);
fillPaint.setTextSize(SkIntToScalar(kPointSize));
fillPaint.setFilterQuality(kLow_SkFilterQuality);
SkPaint outlinePaint;
outlinePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&outlinePaint);
+ sk_tool_utils::set_portable_typeface(&outlinePaint);
outlinePaint.setTextSize(SkIntToScalar(kPointSize));
outlinePaint.setStyle(SkPaint::kStroke_Style);
outlinePaint.setStrokeWidth(0.f);
@@ -112,7 +112,7 @@
SkPaint labelPaint;
labelPaint.setColor(0xff000000);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(12.f);
canvas->translate(15.f, 15.f);
diff --git a/gm/shadertext3.cpp b/gm/shadertext3.cpp
index 47dd29e..07ecd71 100644
--- a/gm/shadertext3.cpp
+++ b/gm/shadertext3.cpp
@@ -73,7 +73,7 @@
SkPaint outlinePaint;
outlinePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&outlinePaint);
+ sk_tool_utils::set_portable_typeface(&outlinePaint);
outlinePaint.setTextSize(SkIntToScalar(kPointSize));
outlinePaint.setStyle(SkPaint::kStroke_Style);
outlinePaint.setStrokeWidth(0.f);
@@ -107,7 +107,7 @@
SkPaint fillPaint;
fillPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&fillPaint);
+ sk_tool_utils::set_portable_typeface(&fillPaint);
fillPaint.setTextSize(SkIntToScalar(kPointSize));
fillPaint.setFilterQuality(kLow_SkFilterQuality);
fillPaint.setShader(shader);
diff --git a/gm/simpleaaclip.cpp b/gm/simpleaaclip.cpp
index 1745eb1..bd9fe2b 100644
--- a/gm/simpleaaclip.cpp
+++ b/gm/simpleaaclip.cpp
@@ -156,7 +156,7 @@
SkPaint textPaint;
textPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&textPaint);
+ sk_tool_utils::set_portable_typeface(&textPaint);
textPaint.setTextSize(SK_Scalar1*24);
int xOff = 0;
diff --git a/gm/srcmode.cpp b/gm/srcmode.cpp
index d089902..ec2673f 100644
--- a/gm/srcmode.cpp
+++ b/gm/srcmode.cpp
@@ -80,7 +80,7 @@
canvas->translate(SkIntToScalar(20), SkIntToScalar(20));
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(0x80F60000);
const Proc procs[] = {
diff --git a/gm/strokefill.cpp b/gm/strokefill.cpp
index f523413..a7e404d 100644
--- a/gm/strokefill.cpp
+++ b/gm/strokefill.cpp
@@ -283,7 +283,7 @@
// use the portable typeface to generically test the fake bold code everywhere
// (as long as the freetype option to do the bolding itself isn't enabled)
- sk_tool_utils::set_portable_typeface_always(&paint, "serif");
+ sk_tool_utils::set_portable_typeface(&paint, "serif");
const unsigned char hiThere[] = "Hi There";
show_bold(canvas, hiThere, SK_ARRAY_COUNT(hiThere), x + SkIntToScalar(430), y, paint);
diff --git a/gm/stroketext.cpp b/gm/stroketext.cpp
index b6c7b1e..6ec425b 100644
--- a/gm/stroketext.cpp
+++ b/gm/stroketext.cpp
@@ -84,7 +84,7 @@
if (true) { test_nulldev(canvas); }
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(kBelowThreshold_TextSize);
draw_text_set(canvas, paint);
diff --git a/gm/textblob.cpp b/gm/textblob.cpp
index aee32b3..cd5c12a 100644
--- a/gm/textblob.cpp
+++ b/gm/textblob.cpp
@@ -72,7 +72,7 @@
protected:
void onOnceBeforeDraw() override {
- fTypeface.reset(sk_tool_utils::create_portable_typeface_always("serif", SkTypeface::kNormal));
+ fTypeface.reset(sk_tool_utils::create_portable_typeface("serif", SkTypeface::kNormal));
SkPaint p;
p.setTypeface(fTypeface);
size_t txtLen = strlen(fText);
diff --git a/gm/textblobcolortrans.cpp b/gm/textblobcolortrans.cpp
index b677681..8b5413a 100644
--- a/gm/textblobcolortrans.cpp
+++ b/gm/textblobcolortrans.cpp
@@ -31,7 +31,7 @@
SkPaint paint;
paint.setTextSize(256);
const char* text = "AB";
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
SkRect bounds;
paint.measureText(text, strlen(text), &bounds);
diff --git a/gm/textblobgeometrychange.cpp b/gm/textblobgeometrychange.cpp
index fa48ee0..fec1ac0 100644
--- a/gm/textblobgeometrychange.cpp
+++ b/gm/textblobgeometrychange.cpp
@@ -31,7 +31,7 @@
const char text[] = "Hamburgefons";
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(20);
paint.setAntiAlias(true);
paint.setLCDRenderText(true);
diff --git a/gm/textblobtransforms.cpp b/gm/textblobtransforms.cpp
index 76342e5..0813d87 100644
--- a/gm/textblobtransforms.cpp
+++ b/gm/textblobtransforms.cpp
@@ -28,7 +28,7 @@
SkPaint paint;
paint.setTextSize(162);
const char* text = "A";
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
SkRect bounds;
paint.measureText(text, strlen(text), &bounds);
diff --git a/gm/textblobuseaftergpufree.cpp b/gm/textblobuseaftergpufree.cpp
index b949fad..3994c5d 100644
--- a/gm/textblobuseaftergpufree.cpp
+++ b/gm/textblobuseaftergpufree.cpp
@@ -39,7 +39,7 @@
const char text[] = "Hamburgefons";
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setAntiAlias(true);
paint.setTextSize(20);
diff --git a/gm/texteffects.cpp b/gm/texteffects.cpp
index af4b12e..03dbd68 100644
--- a/gm/texteffects.cpp
+++ b/gm/texteffects.cpp
@@ -188,7 +188,7 @@
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(56));
SkScalar x = SkIntToScalar(20);
diff --git a/gm/tileimagefilter.cpp b/gm/tileimagefilter.cpp
index 5cf8ab1..9d0f95e 100644
--- a/gm/tileimagefilter.cpp
+++ b/gm/tileimagefilter.cpp
@@ -23,7 +23,7 @@
canvas.clear(0xFF000000);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(0xD000D000);
paint.setTextSize(SkIntToScalar(50));
const char* str = "e";
diff --git a/gm/tilemodes.cpp b/gm/tilemodes.cpp
index 5ff84c8..4e4a2ff 100644
--- a/gm/tilemodes.cpp
+++ b/gm/tilemodes.cpp
@@ -98,7 +98,7 @@
SkPaint p;
SkString str;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&p);
+ sk_tool_utils::set_portable_typeface(&p);
p.setDither(true);
str.printf("[%s,%s]", gModeNames[kx], gModeNames[ky]);
@@ -138,7 +138,7 @@
SkPaint p;
SkString str;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&p);
+ sk_tool_utils::set_portable_typeface(&p);
str.printf("%s, %s", gConfigNames[i], gFilterNames[j]);
canvas->drawText(str.c_str(), str.size(), x, y + r.height() * 2 / 3, p);
}
@@ -218,7 +218,7 @@
SkPaint p;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&p);
+ sk_tool_utils::set_portable_typeface(&p);
p.setTextAlign(SkPaint::kCenter_Align);
for (size_t kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) {
diff --git a/gm/tilemodes_scaled.cpp b/gm/tilemodes_scaled.cpp
index 3d86bc4..87e3029 100644
--- a/gm/tilemodes_scaled.cpp
+++ b/gm/tilemodes_scaled.cpp
@@ -102,7 +102,7 @@
SkPaint p;
SkString str;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&p);
+ sk_tool_utils::set_portable_typeface(&p);
str.printf("[%s,%s]", gModeNames[kx], gModeNames[ky]);
p.setTextAlign(SkPaint::kCenter_Align);
@@ -142,7 +142,7 @@
SkPaint p;
SkString str;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&p);
+ sk_tool_utils::set_portable_typeface(&p);
str.printf("%s, %s", gColorTypeNames[i], gFilterNames[j]);
canvas->drawText(str.c_str(), str.size(), scale*x, scale*(y + r.height() * 2 / 3), p);
}
@@ -222,7 +222,7 @@
SkPaint p;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&p);
+ sk_tool_utils::set_portable_typeface(&p);
p.setTextAlign(SkPaint::kCenter_Align);
for (size_t kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) {
diff --git a/gm/variedtext.cpp b/gm/variedtext.cpp
index b2b96b3..97b3f57 100644
--- a/gm/variedtext.cpp
+++ b/gm/variedtext.cpp
@@ -59,10 +59,10 @@
SkScalar h = SkIntToScalar(size.fHeight);
SK_COMPILE_ASSERT(4 == SK_ARRAY_COUNT(fTypefacesToUnref), typeface_cnt);
- fTypefacesToUnref[0] = sk_tool_utils::create_portable_typeface_always("sans-serif", SkTypeface::kNormal);
- fTypefacesToUnref[1] = sk_tool_utils::create_portable_typeface_always("sans-serif", SkTypeface::kBold);
- fTypefacesToUnref[2] = sk_tool_utils::create_portable_typeface_always("serif", SkTypeface::kNormal);
- fTypefacesToUnref[3] = sk_tool_utils::create_portable_typeface_always("serif", SkTypeface::kBold);
+ fTypefacesToUnref[0] = sk_tool_utils::create_portable_typeface("sans-serif", SkTypeface::kNormal);
+ fTypefacesToUnref[1] = sk_tool_utils::create_portable_typeface("sans-serif", SkTypeface::kBold);
+ fTypefacesToUnref[2] = sk_tool_utils::create_portable_typeface("serif", SkTypeface::kNormal);
+ fTypefacesToUnref[3] = sk_tool_utils::create_portable_typeface("serif", SkTypeface::kBold);
SkRandom random;
for (int i = 0; i < kCnt; ++i) {
diff --git a/gm/xfermodeimagefilter.cpp b/gm/xfermodeimagefilter.cpp
index 1ba1886..3efbbfa 100644
--- a/gm/xfermodeimagefilter.cpp
+++ b/gm/xfermodeimagefilter.cpp
@@ -35,7 +35,7 @@
canvas.clear(0x00000000);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(0xD000D000);
paint.setTextSize(SkIntToScalar(96));
const char* str = "e";
diff --git a/gm/xfermodes.cpp b/gm/xfermodes.cpp
index 93c8bf2..aae8cbd 100644
--- a/gm/xfermodes.cpp
+++ b/gm/xfermodes.cpp
@@ -232,7 +232,7 @@
SkPaint labelP;
labelP.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelP);
+ sk_tool_utils::set_portable_typeface(&labelP);
labelP.setTextAlign(SkPaint::kCenter_Align);
const int W = 5;
diff --git a/gm/xfermodes2.cpp b/gm/xfermodes2.cpp
index ab57dcf..192a279 100644
--- a/gm/xfermodes2.cpp
+++ b/gm/xfermodes2.cpp
@@ -34,7 +34,7 @@
SkPaint labelP;
labelP.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelP);
+ sk_tool_utils::set_portable_typeface(&labelP);
labelP.setTextAlign(SkPaint::kCenter_Align);
const int W = 6;
diff --git a/gm/xfermodes3.cpp b/gm/xfermodes3.cpp
index d4659f0..c5e1695 100644
--- a/gm/xfermodes3.cpp
+++ b/gm/xfermodes3.cpp
@@ -46,7 +46,7 @@
SkPaint labelP;
labelP.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelP);
+ sk_tool_utils::set_portable_typeface(&labelP);
static const SkColor kSolidColors[] = {
SK_ColorTRANSPARENT,
diff --git a/tools/sk_tool_utils.cpp b/tools/sk_tool_utils.cpp
index 4897938..a6d381e 100644
--- a/tools/sk_tool_utils.cpp
+++ b/tools/sk_tool_utils.cpp
@@ -26,7 +26,7 @@
{ "Times New Roman", "Helvetica", "Courier" }, // iOS
{ "Times New Roman", "Arial", "Courier New" }, // Win
{ "Times New Roman", "Arial", "Monospace" }, // Ubuntu
- { "Droid Serif", "Droid Sans", "Droid Sans Mono" }, // Android
+ { "serif", "sans-serif", "monospace" }, // Android
{ "Tinos", "Arimo", "Cousine" } // ChromeOS
};
@@ -159,25 +159,10 @@
}
SkTypeface* create_portable_typeface(const char* name, SkTypeface::Style style) {
- SkTypeface* face;
- if (FLAGS_portableFonts) {
- face = create_font(name, style);
- } else {
- face = SkTypeface::CreateFromName(name, style);
- }
- return face;
-}
-
-SkTypeface* create_portable_typeface_always(const char* name, SkTypeface::Style style) {
return create_font(name, style);
}
void set_portable_typeface(SkPaint* paint, const char* name, SkTypeface::Style style) {
- SkTypeface* face = create_portable_typeface(name, style);
- SkSafeUnref(paint->setTypeface(face));
-}
-
-void set_portable_typeface_always(SkPaint* paint, const char* name, SkTypeface::Style style) {
SkTypeface* face = create_font(name, style);
SkSafeUnref(paint->setTypeface(face));
}
diff --git a/tools/sk_tool_utils.h b/tools/sk_tool_utils.h
index 59ae66a..1d1d365 100644
--- a/tools/sk_tool_utils.h
+++ b/tools/sk_tool_utils.h
@@ -66,28 +66,15 @@
const char* platform_font_name(const char* name);
/**
- * Sets the paint to use a platform-independent text renderer if FLAGS_portableFonts is set.
- * FIXME: will become obsolete as GMs migrate to set portable typeface always.
+ * Sets the paint to use a platform-independent text renderer
*/
void set_portable_typeface(SkPaint* paint, const char* name = NULL,
SkTypeface::Style style = SkTypeface::kNormal);
/**
- * Sets the paint to use a platform-independent text renderer
- */
- void set_portable_typeface_always(SkPaint* paint, const char* name = NULL,
- SkTypeface::Style style = SkTypeface::kNormal);
-
- /**
- * Returns a platform-independent text renderer if FLAGS_portableFonts is set.
- * FIXME: will become obsolete as GMs migrate to set portable typeface always.
- */
- SkTypeface* create_portable_typeface(const char* name, SkTypeface::Style style);
-
- /**
* Returns a platform-independent text renderer.
*/
- SkTypeface* create_portable_typeface_always(const char* name, SkTypeface::Style style);
+ SkTypeface* create_portable_typeface(const char* name, SkTypeface::Style style);
/** Call to clean up portable font references. */
void release_portable_typefaces();