Skip to content Skip to sidebar Skip to footer

Measure Svg Text Dimensions Without Rendering

I would like to calculate a text's width before rendering it (for the purpose of laying out the texts). Using getBBox() works on Chrome browsers but breaks using Firefox (NS_ERROR)

Solution 1:

You probably used the style display: none. Try visibility: hidden instead and .getBBox() should work.


Post a Comment for "Measure Svg Text Dimensions Without Rendering"