#myCanvas
measureText
'Hello World'|'How are you?'|'It is a great day!'
ctx.font='30px Arial'; let m=ctx.measureText(#val); ctx.fillText(m.width,10,30);
your browser does not support the canvas tag
Canvas
❮
Previous
Next
❯
观看不同值的演示
.
或者点击指定值查看结果
在编辑器中更多地使用代码:
亲自尝试一下 ❯