It is hard to know what dimensions text requires, especially if it's rotated. As a result, it is easy to make the viewBox too small and then the text disappears outside the viewBox. However, if the viewBox is too big, then there is a ton of extra whitespace that also gets scaled. Is there a way to scale the viewBox or the svg contents to fit?
I know about preserveAspectRatio to scale a viewBox to the width and height of the svg, but I'm asking about scaling to fit the viewBox.
More generally, how do I approach determining the viewBox dimensions for text?