Specifying the minimal boundingbox/viewport for paths

Hi
I've searched the archives/read some of the SVG specs and can't really
find a solution for this problem:

I'm using Cocoon/Batik to extract/repurpose SVG paths contained in an
XML doc via XSLT to generate individual SVG docs containing only the
path. A single path is primarilly long strings of multiple bezier cubics; 
but can contain
moves and lines too.

I can't figure out: given a set of arbitrary points and control
points within a complex path what the minimal bounding box would be so I can
set it in the svg element's width/height/viewBox attributes.

There is a programmatic solution:
I have found/modified some code to interpolate the bezier cubic, etc
to determine points on the paths; I could then determine min/max
points...but this is screaming for a better way (I would effectively
have to "render" the path to determine the bounding box).

But I'm hoping the SVG spec might support a means for specifiying to the 
rendering engine that the boundingBox is to contain the path for me?

It looks like clippingPaths and masks can be configured to be applied to an 
object's boundingBox - so the rendering engines need to support this type of 
concept...(?)

Can I specify in the svg element (or some other element) that the
viewBox be the minimal size (i.e. a boundingBox-like argument) of the
contained element(s) (in this case a path element) w/o changing the scale or 
aspect ratio of the
contained elements?

Thank you for you assistance
Steve

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

Received on Tuesday, 1 July 2003 09:19:59 UTC