<title>CanvasFormattedText samples</title>
<body style="display:flex;align-items: start;">
<canvas width="500" height="500" style="border:1px solid black"></canvas>
Text wrap width: <input type="number" value="350" min="0" max="450">
<script>
const context = document.getElementsByTagName('canvas')[0].getContext('2d');
const input = document.getElementsByTagName('input')[0];

function repaintCanvas() {
  context.clearRect(0,0,context.canvas.width,context.canvas.height);

  context.font = "30px Ari