[cairo] Creating CMYK and spot colors using Postscript backend

Markus Meyer meyer at mesw.de
Fri May 11 09:13:02 PDT 2007


Behdad Esfahbod schrieb:
> There is currently no support for other color spaces in cairo, no.
> What it takes to implement is is a solid proposal of involved API and
> how it should work, and well, a patch implementing that :).  Many times
> though a solid proposals finds someone implementing it automagically.
>   
Hi Behdad,

I'd definitely be interested to implement/help implementing/sponsor such
support, but I'm afraid my current state of knowledge of the inner
workings of Cairo will not allow me to create a "solid proposal". But I
can somewhat sketch what I'd like to do:

I'd like to have two functions like this:

cairo_set_source_cmyk(cairo_t *cr, double c, double m, double y, double k);
cairo_set_source_spot(cairo_t *cr, const char* name, double c, double m,
double y, double k);

Those would allow to set a CMYK or a Postscript spot color for EPS
output (the spot color has an alternative representation in CMYK for
devices which don't support direct output of spot colors). It would be
acceptable if only the Postscript (and PDF?) backends would support
those commands; the other backends would just throw an error if those
commands are used. At least in the first implementation, it would be the
responsibility of the client controlling Cairo to use the apropriate
color space depending on the output device and hence the client would do
all the color management.

Alternatively, if this is really beyond the scope of what Cairo is
supposed to do, are there any other canvas libraries (C/C++) out there
which have solid support for writing Postscript and PDF files and
include support for TrueType fonts?


Markus



More information about the cairo mailing list