I have created canvas element. Once user add some text with the help of keyboard, on click of done button I want to add text on canvas. I did below changes
1. im
For TypeScript/Angular:
const canvas = document.getElementById('test'); ctx = canvas.getContext('2d'); ctx.font = 'italic 18px Arial'; ctx.textAlign = 'center'; ctx. textBaseline = 'middle'; ctx.fillStyle = 'red'; ctx.fillText('Hello!', 150, 50);