[cairo] PDF Backend for cairo
David Reveman
c99drn at cs.umu.se
Wed Dec 1 02:03:04 PST 2004
On Wed, 2004-12-01 at 02:16 -0500, Kristian Høgsberg wrote:
> Carl Worth wrote:
> > On Mon, 29 Nov 2004 14:59:09 -0500, =?ISO-8859-1?Q?Kristian_H=F8gsberg?= wrote:
> >
> >>I've been working on a PDF backend for cairo over the weekend, and at
> >>this point I think it's appropriate post a snapshot of the current code.
> >
> > Fantastic! It's great to see more progress continuing on this front.
>
> Well, here's a little more progress:
>
> - I found the problem with the "leak" in the polygons, I misunderstood
> the trapezoid format.
> - As described in my other mail, I changed the generated PDF to draw
> all trapezoids as subpaths of one big path and the fill that for each
> call to composite_trapezoids() which solves the problem with cracks in
> the polygons.
> - I added support for constant alpha values
> - I added support for clipping paths
>
> I've uploaded a new patch with these changes:
>
> http://people.redhat.com/krh/cairo-pdf/cairo-pdf-2.patch
>
> and there's an updated snippets.pdf available:
>
> http://people.redhat.com/krh/cairo-pdf/snippets.pdf
>
> The clipping support requires a change to the backend API: I added a
> set_clip_trapezoids() call to cairo_surface_backend_t which works much
> like set_clip_region(), except it takes a list of trapezoids for the
> clipping area. If a backend doesn't support this it must return
> CAIRO_INT_STATUS_UNSUPPORTED as usual. This change isn't fully done
> yet, there's a few issues to work out still.
>
> By the way, in _cairo_gstate_clip() line 1761, the rectangle case ends with:
>
> if (status != CAIRO_INT_STATUS_UNSUPPORTED) {
> _cairo_traps_fini (&traps);
> }
> return status;
>
> Shouldn't this be
>
> if (status != CAIRO_INT_STATUS_UNSUPPORTED) {
> _cairo_traps_fini (&traps);
> return status;
> }
>
> instead?
Exactly. Some time ago I sent a mail to Graydon Hoare who changed this
on 2004-11-05 to have it reverted but I haven't heard back from him yet.
It breaks clipping for all backends that can't handle clipping regions,
so getting it fixed is quite important.
>
> Oh, and another thing: it looks like the show_glyphs function pointer in
> the cairo_surface_backend_t struct can be NULL, in which case it is
> treated as returning CAIRO_INT_STATUS_NOT_SUPPORTED. Is there a reason
> show_glyphs doesn't follow the convention that all function pointers
> must be non-NULL?
>
> cheers,
> Kristian
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo
-David
More information about the cairo
mailing list