SVG text scale - width and height

16,170

Solution 1

You can use the scale(x,y) transform command to scale an element. A scale of 1 is normal size, 0.5 is half normal size, and 2 is double normal size.

For example, add transform="scale(1, 2)" to your tag to scale it normally horizontally and twice the size vertically.

Solution 2

SVG transform on text attribute works excellent!

<text transform="scale(1, 2)" fill="orange" 
font-family="Arial" font-size="70"> 

This snippet, for example, will increase your text by 2x at Y-axis.

Share:
16,170
Admin
Author by

Admin

Updated on June 06, 2022

Comments

  • Admin
    Admin about 2 years

    i would like to scale a text in svg. If i use the font size width and height are scaled. Is there any way for just scaling width or height? - All examples i found using the scale tag witch didn't work or for the text i think.

    Thanks for your help, Hendrik

  • Bjorn
    Bjorn almost 12 years
    This question was not about inkscape.