Hi Thomas,

as long as the code is still here we probably have to deal with it here.
Migrating this stuff is pretty high on my list as soon we have the
preview release out which should happen real soon now.

I recently cleaned up the PDF and PS transcoders so they behave much
more similarly. I may have broken clipping then, although I have done
quite extensive tests. But then, we probably have to set up the same
kind of testing infrastructure we already have for FO.

Unfortunately, I can't quite follow your problem description. Would you
please post an example or describe how I can reproduce the
problem? I can then have a look at it. Thanks.

On 18.10.2005 19:28:24 thomas.deweese wrote:
> 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.

Jeremias Maerki

Reply via email to