HTML and CSS Reference
fillText and strokeText
The context.fillText() function (as shown in Figure 3-1 ) will render solid-colored text to
the canvas. The color used is set in the context.fillColor property. The font used is set in
the context.font property. The function call looks like this:
fillText ([ text ],[ x ],[ y ],[ maxWidth ]);
The text to render on the canvas.
The x position of the text on the canvas.
The y position of the text on the canvas.
The maximum width of the text as rendered on the canvas. At the time of this writing,
support for this property was just being added to browsers.