开发者

SVG: how to position bounding box of rotated text

开发者 https://www.devze.com 2023-01-15 12:47 出处:网络
I have to build a SVG image containing some rotated text elements. I want to achieve the following: Each text element shall be rotated around its center point by a degree.

I have to build a SVG image containing some rotated text elements. I want to achieve the following:

  • Each text element shall be rotated around its center point by a degree.
  • The resulting (imaginary) bounding box of the rotated text shall be translated, so that it's upper left is at position x,y.
  • We do开发者_JAVA百科n't know the content, i.e., the width, of the text elements beforehand.

What is the best way to do that?

(I have a basic understanding of SVG and I am able to look up the spec on my own. So I know about transform and rotate(), translate()... However, I struggle with this specific case.)

0

精彩评论

暂无评论...
验证码 换一张
取 消