JSFiddle - React, Tailwind, and code Playground
HTML
<canvas id="canvas" width="500" height="500"></canvas>
JavaScript
var can = document.getElementById('canvas');
var ctx = can.getContext('2d');
ctx.fillStyle = 'gray';
ctx.fillRect(0,0,500,500);
function drawStroked(text, x, y) {
ctx.font = "80px Sans-serif"
for (var i = 0; i < strokes.length; i++) {
var st_line = strokes[i][0];
var st_color = strokes[i][1];
ctx.strokeStyle = st_color;
ctx.lineWidth = st_line;
ctx.lineJoin="round";
ctx.strokeText(text, x, y);
}
ctx.fillStyle = 'white';
ctx.fillText(text, x, y);
}
var strokes =
[
[32, 'black'],
[28, 'red'],
[18, 'yellow'],
[8, 'black']
];
drawStroked("MVW", 50, 150);