JSFiddle - React, Tailwind, and code Playground
HTML
<canvas id="my_canvas"></canvas>
CSS
@import url('https://fonts.googleapis.com/css2?family=Special+Elite');
JavaScript
function draw()
{
var canvas = document.getElementById("my_canvas");
var ctx = canvas.getContext("2d");
ctx.canvas.width = 150;
ctx.canvas.height = 150;
ctx.fillStyle = "red";
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.font = "40px Special Elite";
ctx.fillStyle = "white";
ctx.fillText("hello", 25, 50);
}
document.fonts.ready.then(function()
{
draw();
});