[dvipdfmx] Possible extensions to color special support

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Sep 2 12:17:17 CEST 2020


Hello all,

Working on some aspects of color support, there are a couple of areas 
where dvipdfmx makes life a little more tricky than pdfTeX, and which I 
hope might be addressed by extending the color specials.

The first area is the stroke/fill ('non-stroke') split. At present, 
"pdf:bcolor" pushes both stroke and non-stroke color to the stack. One 
can set the two separately, but only by using a PDF literal, which 
therefore does not go to the stack. This can lead to 'interesting' 
outcomes if the two are inter-mixed. Would something like

     pdf:strokecolor / pdf:sc
     pdf:fillcolor / pdf:fc

be possible to set only the stroke or fill. Both of these would still 
'pair' with pdf:ec, in the same way in pdfTeX one can do

     \pdfcolorstack <n> push {0.1 0.2 0.3 0.4 k}
     ...
     \pdfcolorstack <n> pop

as well as

     \pdfcolorstack <n> push {0.1 0.2 0.3 0.4 k 0.1 0.2 0.3 0.4 K}
     ...
     \pdfcolorstack <n> pop

The second thing is highlighted in some ways by that pdfTeX example: the 
existence of more than one stack. Additional stacks are useful for 
footnotes, transparency, etc., and so are less easily supported using 
dvipdfmx than with pdfTeX. (When using dvips, one can code in the stacks 
manually using PostScript.) The current 'main' stack approach must of 
course not change, so any pdf:bc or similar will always use this main 
'stack 0'. A possible way to add additional stacks would be to work 
closer to pdfTeX, i.e. have them take 'raw' PDF specs, so perhaps 
pdf:colorstack/pdf:cs

     \special{pdf:cs 1 push 0.1 0.2 0.3 0.4 k}
     ...
     \special{pdf:cs 1 pop}

i.e. syntax

     pdf:cs <n> [push|pop] <PDF literal>

Regards,

Joseph


More information about the dvipdfmx mailing list.