textWidth()
Typography / AttributesDescription
Calculates and returns the width of any character or text string in the current font.
Syntax
float textWidth(std::string s)
Parameters
| Name | Type | Description |
|---|---|---|
| s | std::string | the string to measure |
Returns
floatRelated
Under the Hood
From Processing.h:
float textWidth(const std::string& s);
Under the Hood
From Processing.cpp:
float PApplet::textWidth(const std::string& s) { return getLineWidth(s); }