I am scaling text using CSS transform scale eg
transform: scale(2, 4);
fontSize: 20px // do I need to include fontSize?
I also need to draw the same text on a canvas element
function draw() {
const ctx = document.getElementById('canvas').getContext('2d');
ctx.font = '20px serif';
ctx.fillText('Hello world', 10, 50);
}
How should I scale the text in the above js function? I've hardcoded the font size 20px but how would I use the scale values of 2 and 4?