I've created a unique function that can transform text into an image by following this reference:
Convert Text to Image using javascript
<canvas id='textCanvas' height=20></canvas>
<img id='image'>
<br>
<textarea id='text'></textarea>
js
var tCtx = document.getElementById('textCanvas').getContext('2d'),
imageElem = document.getElementById('image');
document.getElementById('text').addEventListener('keyup', function (){
tCtx.canvas.width = tCtx.measureText(this.value).width;
tCtx.fillText(this.value, 0, 10);
imageElem.src = tCtx.canvas.toDataURL();
console.log(imageElem.src);
}, false);
Check out the jsfiddle provided in the original post: http://jsfiddle.net/amaan/WxmQR/1/
However, it appears that the resolution is too low for practical use. How can I enhance the resolution in this scenario?