Aastha Sethia
Aastha Sethia

Reputation: 39

How do I rotate text to 90 degrees while writing it in an svg file

I am creating a svg file and adding text to it using svgwrite, if the width of my text id is 0 I need it to be 90 degrees rotated

This is how I am doing it but I am still not able to get it rotated

if (int(text_list[i]['width']) == 0):
    g.add(dwg.text(string, insert=(left, top), transform="rotate(90)"))

Upvotes: 1

Views: 1141

Answers (1)

Aastha Sethia
Aastha Sethia

Reputation: 39

 pcRotate = 'rotate(270,%s, %s)' % (left,top)
 g.add(dwg.text(string, insert=(left, top), transform= pcRotate)

on specifying the points around which I need to rotate the text, I am getting the desired results.

Upvotes: 1

Related Questions