I got a problem with circled text related to SVG. My goal is to create path that will allow me to write on it but also center the text, still keeping track with my path - from the top part of the circle.
Example
That's what it looks like (image inside)
Problem
Currently I'm using textPath + path combination to generate path and write on it.
<svg>
<defs>
<path id="textPath" d="M 200 175 A 25 25 0 0 0 182.322 217.678" />
</defs>
<text x="25" y="0"><textPath xlink:href="#textPath" startOffset="0" >here goes my text</textPath></text>
</svg>
I also tried Raphael library to manage it work, but seriously I can't do what I want. Is here somebody who actually managed to make it work? Or is there any way to make it so?
define your text path as the complete upper hemisphere of the elliptical arc you want to draw on:
and set the
startOffset
of yourtextPath
to 50%. note that your svg file is not well-formed as it is lacking the namespace definition for xlink. the following is a working standalone example:re: comment on a solution for going all teh way around the circle: the gist is to define the text path to extend along the whole circumference, like this: