Having trouble de-skewing svg text on path

2019-08-17 17:05发布

I am trying to draw names along an elliptical path on the outside of a table for an HTML5 card game. I have seen this done without skew here, but the text became skewed when I adjusted the s' data attribute to perfectly fit the curve of the table. Is this possible?

My current code is here (notice the path used for the text in black or cyan): http://vedanamedia.com/clients/intuitive-eye/forums/2-svg-text-path/

And this is what I'm going for (notice names neatly following outer curve around the table):

design comp

标签: css svg
1条回答
smile是对你的礼貌
2楼-- · 2019-08-17 17:43

The reason this is happening is because you are designing everything based on a circle in your SVG, but are then stretching it to an ellipse shape. This is what is causing your "skew" problems.

viewBox="0 0 100 100" height="739" width="1086.4872340425532"

If you want to get rid of the skew, make your path curves elliptical rather than semi-circular. Your viewBox should have the same aspect ratio as your width/height.

查看更多
登录 后发表回答