Horizontally scaled font via drawText?

77 views Asked by At

Is there an elegant way to put text in canvas via drawText, so that it is squeezed horizontally/vertically?

1

There are 1 answers

3
markE On BEST ANSWER

"Elegant?, Well...Kind of yes!"

You can scale the canvas horizontally and the text will be squeezed.

ctx.scale(.80,1);
ctx.fillText("Squeezed!",15/.80,30);
ctx.scale(-0.80,1);

enter image description here