How to use the DOM API with graphical text using canvas in Javascript

1 Answer

0 votes
var canvas = document.createElement('canvas');
canvas.width = 600;
canvas.height = 300;

var ctx = canvas.getContext('2d');

ctx.font = '30px Arial';
ctx.fillText("JavaScript Programming", 35, 35);

document.body.appendChild(canvas);
 
/*
run:
 
JavaScript Programming
 
*/

 



answered Jul 22, 2017 by avibootz
...