You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Larry Ai <la...@yahoo.com> on 2003/09/25 23:08:53 UTC

duplicates in SVG document

All:

    I generated a svg document (using
SVGGraphic2D.stream()) from a SVGGraphic2D object.

    I discovered that there are duplicates in the
output:

    For example:

      <polygon style="font-size:348.70587158203125;
font-family:&apos;Courier&apos;; stroke:none;"
points=" 4548 -27823 4397 -27823 4472 -28706" />
      <polygon style="fill:none;
font-size:348.70587158203125;
font-family:&apos;Courier&apos;;" points=" 4548 -27823
4397 -27823 4472 -28706" />

    There are the same polygons (same x and y
coordinates) but with some different attributes.

    Does anyone know how to get rid of those
duplicates?

    Thanks!

Larry

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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


Re: duplicates in SVG document

Posted by Thomas DeWeese <Th...@Kodak.com>.
Larry Ai wrote:

> All:
> 
>     I generated a svg document (using
> SVGGraphic2D.stream()) from a SVGGraphic2D object.
> 
>     I discovered that there are duplicates in the
> output:

   These aren't really 'duplicates' one is the fill
one is the stroke.  The problem is that Java2D doesn't
have a fill/stroke operation and due to concerns about
'morphing' shape objects it is difficult to ensure that the
filled shape is the same as the stroked shape.

>     There are the same polygons (same x and y
> coordinates) but with some different attributes.
> 
>     Does anyone know how to get rid of those
> duplicates?

    Write code to detect when the stroked object
is the same as the immediately previously filled
object (perhaps by comparing the generated 'd'
attributes?) in the SVGGraphics2D or AbstractGraphics2D
class and contribute it to Batik :)




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