The strokeText() function
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
- The text to display
- The X coordinate
- The Y coordinate
An example
<script> window.onload = function () { var canvas = document.getElementById("cvs"); var context = canvas.getContext('2d'); context.font = '36pt Arial'; context.strokeText('Some example text', 50, 50); } </script>
See also