38 {
39 {
41 const char*
txt =
"Blobber";
42 size_t txtLen = strlen(
txt);
45 }
46
48 font.setSubpixel(
true);
51
53 int glyphCount = fGlyphs.
size();
55
56 run = &
builder.allocRun(font, glyphCount, 10, 10,
nullptr);
57 memcpy(
run->glyphs, fGlyphs.
begin(), glyphCount *
sizeof(uint16_t));
58
59 run = &
builder.allocRunPosH(font, glyphCount, 80,
nullptr);
60 memcpy(
run->glyphs, fGlyphs.
begin(), glyphCount *
sizeof(uint16_t));
61 for (int i = 0; i < glyphCount; ++i) {
62 run->pos[i] =
font.getSize() * i * .75f;
63 }
64
65 run = &
builder.allocRunPos(font, glyphCount,
nullptr);
66 memcpy(
run->glyphs, fGlyphs.
begin(), glyphCount *
sizeof(uint16_t));
67 for (int i = 0; i < glyphCount; ++i) {
68 run->pos[i * 2] =
font.getSize() * i * .75f;
69 run->pos[i * 2 + 1] = 150 + 5 * sinf((
float)i * 8 / glyphCount);
70 }
71
73
77
79 for (
unsigned i = 0; i < std::size(
pos); ++i) {
81 }
82
87 std::size(colors),
89 }
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
@ kUTF8
uses bytes to represent UTF-8 or ASCII
@ kAntiAlias
may have transparent pixels on glyph edges
static sk_sp< SkShader > MakeRadial(const SkPoint ¢er, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
PODArray< SkColor > colors
font
Font Metadata and Metrics.
static constexpr SkPoint Make(float x, float y)