diff --git a/src/typography/attributes.js b/src/typography/attributes.js index d6a5eb8d5e..08f79085e9 100644 --- a/src/typography/attributes.js +++ b/src/typography/attributes.js @@ -253,6 +253,19 @@ p5.prototype.textStyle = function(theStyle) { /** * Calculates the maximum width of a string of text drawn when * text() is called. + * * + *
Note:
+ *
+ * In p5.js 2.0, textWidth() may return 0 when
+ * measuring a string that contains only whitespace characters,
+ * such as a single space (' '). In earlier versions,
+ * whitespace contributed to the measured width.
+ *
+ * This behavior differs from fontWidth(), which measures
+ * individual glyph widths, including whitespace.
+ *