Мы можем использовать метод strokeStyle для рисования границы вокруг текста или контура, и мы можем использовать метод lineWidth для определения ширины линии штриха.
<script>
var canvas = document.getElementById('Canvas01');
var ctx = canvas.getContext('2d');
ctx.strokeStyle= "red"; //set the color of the stroke line
ctx.lineWidth = 3; //define the width of the stroke line
ctx.font = "italic bold 35pt Tahoma"; //set the font name and font size
ctx.strokeText("StackOverFlow",30,80); //draw the text
</script>
</body>