Name

CRC.measureText() — computes the width of the specified text

Synopsis

TextMetrics measureText(String text)

Arguments

text

The string of text to be measured

Returns

A TextMetrics object whose width property specifies the width that text would occupy if it were drawn with the current font.

Description

measureText() measures the specified text and returns a TextMetrics object containing the results of the measurement. At the time of this writing, the returned object has only a single width property, and the text height and bounding box are not measured.

See Also

TextMetrics

Get Canvas Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.