JSFiddle - React, Tailwind, and code Playground

HTML

<canvas id="c" width="300" height="600"></canvas>

JavaScript

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

var font = '12px "Arial Narrow"';
ctx.font = font;
ctx.fillText(font, 20, 20);
font = '12px Arial';
ctx.font = font;
ctx.fillText(font, 20, 40);
font = '12px "Times New Roman"';
ctx.font = font;
ctx.fillText(font, 20, 60);