measureText method
Returns a CanvasTextMetrics object that contains the width of the specified text.
Syntax
ICanvasTextMetrics retVal = object.measureText(text);
Parameters
text [in]
Type: stringThe text to measure.
Standards information
- HTML Canvas 2D Context, Section 11
Remarks
To get accurate measurements across different browsers, set the font and styles for text before getting your measurement. Measurements might still differ between browsers.