Implementing a variation of Joachim Ungar's curved label placement method described here. The basic process is:
- Turn the shape into a polygon of evenly-spaced points.
- Generate a Voronoi diagram of those points.
- Clip the edges.
- Turn the edges into a graph.
- Find the "longest shortest path" between any pair of perimeter nodes.
- Smooth/simplify that path a bit.
- Place text along the smoothed centerline with a
<textPath>
.