简体   繁体   English

将文本写入 svg 文件时如何将其旋转 90 度

[英]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我正在创建一个 svg 文件并使用 svgwrite 向其中添加文本,如果我的文本 ID 的宽度为 0,我需要将其旋转 90 度

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)"))
 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.在指定我需要旋转文本的点时,我得到了想要的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM