How can I write text on a HTML5 canvas element?
canvas, html
Solution
var canvas = document.getElementById("my-canvas");
var context = canvas.getContext("2d");
context.fillStyle = "blue";
context.font = "bold 16px Arial";
context.textAlign = 'center';
context.textBaseline = 'middle';
context.fillText("Zibri", (canvas.width / 2), (canvas.height / 2));
#my-canvas {
background: #FF0;
}
<canvas id="my-canvas" width="200" height="120"></canvas>
Problem
Is it possible to write text on HTML5 `canvas`?