通过drawText水平缩放字体?

时间:2015-06-10 18:53:16

标签: javascript html html5-canvas

是否有一种优雅的方式通过drawText将文本放入画布中,以便水平/垂直挤压?

1 个答案:

答案 0 :(得分:1)

“优雅?,嗯......好吧!”

您可以水平缩放画布,然后挤压文本。

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

enter image description here

相关问题