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
).
What is the suggested way to calculate SVG text dimensions without rendering it?
You probably used the style
display: none
. Tryvisibility: hidden
instead and.getBBox()
should work.