Text on a Shape
Background
SVG has had
Text
on a path since the beginning. We have been requested to
extend this to allow text on a shape. This avoids the need to
convert shapes to paths prior to using them with <textPath>.
Typical uses:
Originally, Inkscape drew circles and ellipses using paths, now that
Inkscape uses the circle and ellipse elements, people are asking why
can't you put text on circles and ellipses?
Requirements
The major requirement for how SVG shapes should be converted to paths
has been solved in the discussion of
markers on shapes:
- ... rounded rects start at straight horizontal line of the
top left
- ... rounded rects wind clockwise and include 0 length
segments when the rounder corner is 50%
- ... for ellipses and
circles, the path starts at right-most point and consists of 4
arcs going clockwise and each are 90 degrees
Challenges
-
How do you place text along the inside of a circle?
Would it be better to have a property to specify the side of
the path to draw the text?
- What happens if you set startOffset negative?
- What happens if you run off the "end" of the path, should you wrap around?
- Could startOffset use variable path-width syntax?
This would be useful even for normal paths: