strokeText method

void strokeText(
  1. String text,
  2. num x,
  3. num y, [
  4. num maxWidth,
])

The CanvasRenderingContext2D method strokeText(), part of the Canvas 2D API, strokes — that is, draws the outlines of — the characters of a text string at the specified coordinates. An optional parameter allows specifying a maximum width for the rendered text, which the will achieve by condensing the text or by using a lower font size.

This method draws directly to the canvas without modifying the current path, so any subsequent CanvasRenderingContext2D.fill or CanvasRenderingContext2D.stroke calls will have no effect on it.

Note: Use the CanvasRenderingContext2D.fillText method to fill the text characters rather than having just their outlines drawn.

Implementation

external void strokeText(
  String text,
  num x,
  num y, [
  num maxWidth,
]);