Name

CRC.strokeText() — draws outlined text

Synopsis

void strokeText(String text, float x, float y,float max)

Arguments

text

The text to draw in the canvas

x, y

The “anchor point” of the text in the canvas

max

An optional maximum width for the text

Description

strokeText() works just like fillText() except that instead of filling the individual character glyphs with fillStyle, it strokes the outline of each glyph using strokeStyle. strokeText() produces interesting graphical effects when used at large font sizes, but fillText() is more commonly used for actually drawing text.

Get Canvas Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.