HTML5 Canvas Text Metrics Tutorial

To get the text metrics of HTML5 Canvas text, we can use the measureText() method of the canvas context which returns an object containing a width property.  This method requires a text string and returns a metrics object based on the provided text and the current text font assigned to the context.

Note: Since the height of the text in pixels is equal to the font size in pts when the font is defined with the font property of the canvas context, the metrics object returned from measureText() does not provide a height metric.

邮箱:
密码:

微信扫描二维码捐赠

当前实例由www.100sucai.com整理,
仅作学习参考。感谢大家对本站的支持
web前端交流群:Css Js 网站美工
Text Wrap