参考 textWidth()

textWidth()

调用 text() 时,计算绘制的文本字符串的最大宽度。

示例

语法

textWidth(str)

参数

str
字符串:

要测量的文本字符串。

返回值

数字: 宽度以像素为单位测量。
This page is generated from the comments in src/typography/attributes.js . Please feel free to edit it and submit a pull request!

相关参考