JSFiddle - React, Tailwind, and code Playground

by Amatewasu

HTML

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

JavaScript

var canvas = document.getElementById('canvas'),
    ctx = canvas.getContext("2d");

ctx.fillStyle = "black";
ctx.fillText("Bonjour je m'appelle Alexis et je suis super fort", 10, 10, 100);

console.log(ctx.measureText("Bonjour je m'appelle Alexis et je suis super fort"));