skia2/gm/text_scale_skew.cpp
Hal Canary 9b491b23bb SkPDF: fix fTextScaleX error
BUG=skia:7315
Change-Id: Ic613cb6fb8faed5b0840db4f500940bd6823de66
Reviewed-on: https://skia-review.googlesource.com/76981
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-11-28 20:48:37 +00:00

28 lines
700 B
C++

/*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "gm.h"
// http://bug.skia.org/7315
DEF_SIMPLE_GM(text_scale_skew, canvas, 256, 128) {
SkPaint p;
p.setTextSize(18.0f);
p.setAntiAlias(true);
p.setTextAlign(SkPaint::kCenter_Align);
float y = 10.0f;
for (float scale : { 0.5f, 0.71f, 1.0f, 1.41f, 2.0f }) {
p.setTextScaleX(scale);
y += p.getFontSpacing();
float x = 50.0f;
for (float skew : { -0.5f, 0.0f, 0.5f }) {
p.setTextSkewX(skew);
canvas->drawString("Skia", x, y, p);
x += 78.0f;
}
}
}