[cairo] Zero length segment and SVG

Jeff Muizelaar jeff at infidigm.net
Sun Jun 25 13:31:42 PDT 2006


On Sun, Jun 25, 2006 at 05:40:37PM +0200, Carl Worth wrote:
> On Sat, 24 Jun 2006 23:41:20 -0400, Jeff Muizelaar wrote:
> > It still needs more work though.
> 
> Can you describe in more detail what you mean here?

I think it would be good to add or modify an exisiting testcase to
exercise the closed-dashed-path-missing-leading-cap bug that Keith Wells
reported in the "cairo stroke problem with potential patch" thread. I'd
also like to look into the behaviour of degenerate dashed sub-paths to
make sure we have consistent behaviour.

> I feel really good about the state this ends up with, and I would be
> glad to push this out right away and have it in place for 1.2. There
> are still ps and svg failures for the degenerate-path tests, but I
> don't think those will be too bad to clean up.

The ps failures are caused by ghostscript rasterization differences. I
don't build with the svg backend so I don't know about that failure.

> Here is the documentation I added to cairo_set_dash:
[snip]
> And here is the documentation I added to cairo_stroke:
[snip]

Thanks for the added documentation. It looks good. Documentation was
also one of the other things that I was refering to when I said "Needs
more work".

> > Note: the test case exercises a bug in the postscript surface that
> > causes it to split the ~> of a base85 stream across two lines.
> > Ghostscript doesn't like this very much.
> 
> Hmmm... will have to look at that.

Here is the current work around I am using:

diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index ced69e2..8100e78 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -1336,6 +1336,12 @@ _string_array_stream_write (cairo_output
 	    stream->column++;
 	    stream->string_size++;
 	    break;
+	case '~':
+	    _cairo_output_stream_write (stream->output, &c, 1);
+	    stream->column++;
+	    stream->string_size++;
+	    c = *data++;
+	    break;
 	}
 	_cairo_output_stream_write (stream->output, &c, 1);
 	stream->column++;
-Jeff


More information about the cairo mailing list