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.
This page is generated from the comments in src/typography/attributes.js . Please feel free to edit it and submit a pull request!

Related References