xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: Optimizing SVG via XSL
Date Thu, 26 Oct 2006 09:53:45 GMT
Hi Archie,

"Archie Cobbs" <archie.cobbs@gmail.com> wrote on 10/24/2006 09:48:08 AM:

> On 10/24/06, thomas.deweese@kodak.com <thomas.deweese@kodak.com> wrote:
> > > then consolidated consecutive <path> elements into a single
> > > <path> element.
> >
> >    How do you determine if it's safe to consolidate consecutive
> > <path> elements?  Since styling is done by CSS this would seem
> > essentially impossible in the general case (selectors) so what
> > assumptions do you make?
> 
> My algorithm may very well be wrong in the general case but works for
> the documents I've been using. The logic is simply that two
> consecutive path elements will be consolidated if they have the exact
> same set of attributes, other than the "d" and "pathLength"
> attributes.

   Ohh, this won't even work for normal elements if they have a
stroke, unless the element's don't overlap.  It will change
fill1 -> stroke1 -> fill2 -> stroke2 into 
fill1 -> fill2 -> stroke1 -> stroke2.   So if any part of 'stroke1'
should be hidden by 'fill2' it won't be anymore.  This might still
be a useful enhancement but it can easily change rendering...

> I'm not familiar enough with CSS and selectors (what are those? :-) to
> know if this logic would break documents using them. 

    Selectors allow you to more or less arbitrarily change
the 'style' of an element in the DOM based on many things (see
my example at the end for just one example of this).

> I had assumed that if two <path>'s had the same attributes 
> then you could consolidate them, but maybe this is not true?

   This is not true in the general case.  The work is still
useful but the assumptions the scripts use should be documented
(as well as at least the above two potential problems).

   Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message