Name

TextMetrics — measurements of a string of text

Synopsis

A TextMetrics object is returned by the measureText() method of CanvasRenderingContext2D. Its width property holds the width of the measured text, in CSS pixels. Additional metrics may be added in the future.

Properties

readonly double width

The width, in CSS pixels, of the measured text.

Get JavaScript: The Definitive Guide, 6th Edition 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.