We can create a text image using HTML canvas.
Build a canvas to hold the image pixel info.
var canvas = document.createElement('canvas'); canvas.width = 500; canvas.height = 250;
Then we need to select a context for the canvas. We can add 2d for two dimensional.
var ctx = canvas.getContext('2d');
Finally, we can add text properties to draw the final text image.
ctx.font = '10px Cursive'; ctx.fillText("HTML Canvas!", 0, 30);
Now, all we need to do is to add the newly created image to the body.
This is how it will look like:
appendChild canvas drawing font html tags images