[cairo] pdf backend (issue with transparency)

Ross McFarland rwmcfa1 at neces.com
Mon May 17 18:43:13 PDT 2004

back-end (messy b/c i'm trying lots of stuff, but decently functional):

if you want to build it (adds it to the configure script, makefiles and

slightly modified basket.c (don't output png image first, cairo bug):

same basket.c, with alpha 0.5 on fill:
this demo code:

the problem is the back-end gets lots of little traps that when
converted to paths (apparently) slightly overlap which totally blows
alpha in the pdf. i'm out of ideas about what to do about it at the
moment. my first thought was to only fill and not stroke, but that
didn't fix the problem and causes other visual artifacts at the

solid patterns (colors) are implemented, and all of the demos using only
those seem to work fine (excluding alpha.)

to some degree i'm running into walls that involve my understanding of
how cairo works: surface patterns, how images come down, stuff like
that. beyond that i'm not completely sure what to make of some of the
parameters coming into some of the functions. things i could probably
figure out in time, but help is appreciated.

i open the code up to comments (other than the fact that it's somewhat
messy, which i know, and will work to clean up.) basically i created a
simple list object up top that's used quite extensively throughout the
rest of the code. that's probably the best place to start, it's pretty
straightforward (and could possibly be replaced by a better mechanism.) 

the foundation upon which full function could be built is there. as far
as the pdf file format and stuff goes there's not much missing (native
pdf fonts, but that's a cairo wide problem as i understand it), its just
a matter of converting what the back-end gets into equivalent pdf

if there's other people interested in looking at pieces and parts it
will probably come along much quicker, especially if those people are
more familiar with cairo internals.

comments/questions/opinions welcome,

More information about the cairo mailing list