JSFiddle - React, Tailwind, and code Playground

by brigand

HTML

<canvas id="can" width="500" height="500"></canvas>

JavaScript

const ctx = can.getContext('2d');
ctx.font = '20px Arial'
ctx.fillText('Hello, world!', 100, 100)
console.log(ctx.measureText('Hello, world!'))