JSFiddle - React, Tailwind, and code Playground
by behdad
HTML
<canvas id="canvas" width="300" height="300">
</canvas>
JavaScript
text = '\u200D\u0628';
var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
context.font = '48pt Times New Roman';
var x = 50;
context.fillStyle="#ec6";
context.fillText(text, 50, 200);
width = context.measureText(text).width;
context.strokeStyle = "#f00";
context.strokeRect(50, 0, width, 300);