How to draw decorated text with strokeText() on a given (x, y) position with using specific font in JavaScript

1 Answer

0 votes
<canvas id="canvas"></canvas>
<script type="text/JavaScript">   

var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");

ctx.font = "32px serif";
ctx.strokeText("PHP Programming", 40, 90);

/*
run:  
    
  PHP Programming
   
*/
  
</script>

 



answered May 24, 2016 by avibootz
...