[XeTeX] cmyk colour support broken?

Jonathan Kew jonathan_kew at sil.org
Fri May 19 17:03:08 CEST 2006


On 19 May 2006, at 3:40 pm, William Adams wrote:

> I'm setting up a journal in XeTeX, but I'm not able to get process
> black type:
>
> %!TEX TS-program = xelatex
> \documentclass{minimal}
> \newcommand{\blacktype}[1]{\special{color push}\special{color cmyk 0
> 0 0 1}#1\special{color pop}}
> \newcommand{\graytype}[1]{\special{color push}\special{color gray 0}#1
> \special{color pop}}
> \newcommand{\cyantype}[1]{\special{color push}\special{color cmyk 1 0
> 0 0}#1\special{color pop}}
> \begin{document}
> \blacktype{This should be process black, no cyan, magenta or yellow,
> but instead it has all of the above}
>
> \graytype{This should be defined as gray, hence black only, but is a
> rich black as above}
>
> \cyantype{This is cyan, no magenta, yellow or black}
> \end{document}
>
> The cmyk colour model works _if_ I include a cyan, magenta and/or
> yellow component, but fails when trying to make something which is
> only black.
>
> Any idea why?

This is probably because xdv2pdf doesn't really know how to do CMYK  
colo[u]r; it converts it internally to RGB and passes that on  
CoreGraphics when it draws the text.

The original reason for this is that the first form of color  
supported in XeTeX was the font attribute (rather than \specials),  
which was rendered directly through ATSUI styles; and ATSUI only  
supports RGB(A) color specification. This is no longer how things  
work; I don't draw through ATSUI any more, but directly with  
CoreGraphics, having used ATSUI to get the positioned glyphs -- so in  
principle, I think xdv2pdf could be revised to use proper CG color  
spaces, etc. Just hasn't happened yet. Sorry!

If you're only using OpenType (rather than AAT) fonts, and could  
render the document on Linux using xdvipdfmx as the driver, that  
might work better -- I don't know what the color support is like  
there, but it's probably better.

JK



More information about the XeTeX mailing list