writeTextToCanvas

external fun writeTextToCanvas(text: String, options: WriteTextToCanvasOptions? = definedExternally): HTMLCanvasElement?(source)

Writes the given text into a new canvas. The canvas will be sized to fit the text. If text is blank, returns undefined.

Return

A new canvas with the given text drawn into it. The dimensions object from measureText will also be added to the returned canvas. If text is blank, returns undefined.

Parameters

text

The text to write.

See also