HTML and CSS Reference
As you might have noticed, while Canvas does a pretty good job of displaying a single line of
text, displaying multiline text is another story. We have shown you one possible solution, but
something else might be in order in the future. According to the W3C Canvas API specifica-
tion, there might be a change in the future that opens the door for using CSS on the Canvas:
A future version of the 2D context API may provide a way to render fragments of documents,
rendered using CSS, straight to the canvas. This would be provided in preference to a dedicated
way of doing multiline layout.
CSS would help developers render text on the Canvas and, at the same time, encourage deve-
lopers to adopt the Canvas for text-based applications.