Hi all,

   I don't know if you want to deal with this here in FOP land or over in 
Batik land but since the
code in question is currently in FOP I thought I would start here.  The 
PDF transcoder is
currently broken.  This appears to be due to a recent change to the way 
clips are done.
Previously a new clip was done something like:

        Shape oldClip = g2d.getClip();  // get clip, in the current 
coordinate system
        g2d.clip(newAdditiveClip);

        // Draw things, blah blah

        g2d.setClip(oldClip);  // restore clip, in current coordinate 
system.

----
        This as it turns out has problems, the basic issue is that the 
clip can
'waver' as it is gotten and restored in various coordinate systems (shift 
one pixel left or 
right).   To avoid  the need to get and restore the clip I started using 
the 'create' 
method of the Graphics.  So the new code looks something like:

        g2d = g2d.create();                  // create new graphics with 
independent drawing state
        g2d.clip(newAdditiveClip);

        // Draw things, blah blah

        g2d.dispose();  // parent node will use 'old' graphics 2D.

----

        The real code is a bit more complex than this but you get the
idea.  The problem is that the PDFGraphics2D doesn't seem to properly
implement 'create()'.  I've tried to hack this in but I get garbage PDF 
out.

        So what I'm looking for is a basic analysis of how hard this would
be to fix, as well as suggestions on how to fix it.  There are some other
potential solutions to the wavering clip issue, although I think the above 
is
by far the cleanest (and hence most desirable) of them.

Reply via email to