Reference textWidth()

textWidth()

Calculates the maximum width of a string of text drawn when text() is called.

Examples

Syntax

textWidth(str)

Parameters

str
String:

string of text to measure.

Returns

Number: width measured in units of pixels.
Notice any errors or typos? Please let us know. Please feel free to edit src/typography/attributes.js and open a pull request!

Related References