JSFiddle - React, Tailwind, and code Playground

HTML

<html>
<body>

<canvas id="myCanvas" width="400" height="400" style="border:0px;">
Your browser does not support the HTML5 canvas tag.</canvas>

</body>
</html>

JavaScript

var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.beginPath();
ctx.arc(200, 200, 100, 0, 2 * Math.PI);
ctx.stroke();

var score = 0;score++;

ctx.fillText(score,200,200);

score += 1234;
ctx.fillText(score,200,200);


//attempt to center the score dynamically
score.style.fontSize = 26; // 26 being the fontSize
score += 12034;
var height = (score.clientHeight + 1);
var width = (score.clientWidth + 1);
ctx.fillText(score,height,width);