Skip to main content

Home > blockly > utils > dom > getTextWidth

utils.dom.getTextWidth() function

Gets the width of a text element, caching it in the process.

Signature:

export declare function getTextWidth(textElement: SVGTextElement): number;

Parameters

ParameterTypeDescription
textElementSVGTextElementAn SVG 'text' element.

Returns:

number

Width of element.