Bug 6425

Summary: <textPath> element not implemented
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: a.neumann, ian
Priority: P4    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Bug Depends on: 6420, 12376    
Bug Blocks:    

Description Eric Seidel (no email) 2006-01-08 01:52:27 PST
<textPath> element not implemented
http://www.w3.org/TR/SVG/text.html#TextPathElement

This will require further enhancements to RenderText.  Once list offsets and rotations are respected, this 
becomes a straightforward extension of that logic.
Comment 1 Eric Seidel (no email) 2006-12-31 13:11:33 PST
We now have path measuring in place with bug 12033.  I even added a couple member variables to PathTraversalState which could be used by future traversal code to lay out text on a path.

        // FIXME: for (non-implemented) text-on-path layout
        Vector<float> m_offsets;
        Vector< std::pair<FloatPoint, float> > m_pointAndAngles;

Calculating the normal vectors for the curve as its measured is very easy.  Once the curveLength function finds two points sufficiently close it stops, at that point, the line between those two points is tangent to the normal.  Given that normal and a point obtained (in the same was as pointAtLength obtains points) that should be sufficient to place the text.  I don't know enough about the text system (and what points might be desired) so I haven't wired that part up.  But the actual path traversal/measurement/normal calculation code should be very straightforward.
Comment 2 Nikolas Zimmermann 2007-03-04 04:37:23 PST

*** This bug has been marked as a duplicate of 12698 ***