Answer the question
In order to leave comments, you need to log in
How to calculate viewBox for text in SVG?
I want to make the SVG text, and then use it as a background-image.
I will insert from a sprite or inline.
But, I can not understand how the viewBox is calculated.
For example, how to calculate the size of the viewBox for the text "Hello", in the example below, I put them at random.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 35">
<text x="0" y="50" font-family="Verdana" font-size="35px" fill="gray">Привет</text>
</svg>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question