开发者

html5 canvas - How do I determine the width of a character?

开发者 https://www.devze.com 2023-03-08 19:54 出处:网络
I\'m using .fillText withfixe开发者_如何学编程d width font. I can set the height of the font by setting .font. but how can I determine the resulting width of a character?Try measureText(\"a\") where a

I'm using .fillText with fixe开发者_如何学编程d width font. I can set the height of the font by setting .font. but how can I determine the resulting width of a character?


Try measureText("a") where a is the character you wish to measure. For fixed width font, it should all be the same.

0

精彩评论

暂无评论...
验证码 换一张
取 消