Search code examples
textsvgscale

SVG text scale - width and height


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


Solution

  • 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.