📘 Calculates and returns the width of a given string of text.
string to measure
width of the text in pixels
q5.draw = function () { background(0.8); textSize(abs(mouseX)); rect(-90, 90, textWidth('A'), -textLeading()); text('A', -90, 90);}; Copy
q5.draw = function () { background(0.8); textSize(abs(mouseX)); rect(-90, 90, textWidth('A'), -textLeading()); text('A', -90, 90);};
📘 Calculates and returns the width of a given string of text.