[Webkit-unassigned] [Bug 12033] New: SVG needs ability to calculate path lengths

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 29 20:58:40 PST 2006


http://bugs.webkit.org/show_bug.cgi?id=12033

           Summary: SVG needs ability to calculate path lengths
           Product: WebKit
           Version: 420+ (nightly)
          Platform: Macintosh
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: SVG
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: macdome at opendarwin.org
                CC: zimmermann at kde.org


SVG needs ability to calculate path lengths

This is arguably a platform bug as much as an SVG bug.

SVG requires the ability to calculate path lengths.  Both total path length, as
well as the ability to identify a segment at a given length along a path.

Calculating the length of a bezier curve is non-trivial, and most algorithms
use successive approximation of the curve length.

We have several options here:
1.  I expect CoreGraphics (or some other library on OS X) has this
functionality (possibly not via public methods) that with a little help from
the Apple folks, we could find and expose via WebKitSystemInterface.
2.  mozilla has their own code for this:
http://lxr.mozilla.org/seamonkey/source/content/svg/content/src/nsSVGPathSeg.cpp#90
which we potentially could borrow, since I believe mozilla's triple license is
compatible with WebKit's BSD/LGPL licensing.
4.  There may be some other library or code snippet out there that we could use
5.  We could write our own.  I'm sure one of us has a CS book which documents a
decent algorithm or two.  There are also various guides on the web: (e.g.
http://72.14.203.104/search?q=cache:lXe763sRSqMJ:www.cs.uiowa.edu/~kearney/22c196Spring03/ArcLengthParameterization.ppt+approximate+bezier+curve+length&hl=en&gl=us&ct=clnk&cd=5&client=safari)

In any case, this will require a non-trivial amount of effort, but the results
of which enable quite a few SVG features (including text-on-path).


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list