Canvas reference: The strokeText() function

Summary: The strokeText() function adds outlined text to your canvas. It does not fill the text - for that you want the fillText() function

[No canvas support]

The strokeText() function is very similar to the fillText() function - however it draws the outline of the text and doesn't fill it - as you can see from the example. In many use cases you can use the fillText() function and ignore this entirely.

Arguments to the function

An example

    window.onload = function ()
        var canvas  = document.getElementById("cvs");
        var context = canvas.getContext('2d');

        context.font = '36pt Arial';
        context.strokeText('Some example text', 50,  50);

See also