[dvipdfmx] Multiple color stacks

Joseph Wright joseph.wright at morningstar2.co.uk
Tue Apr 19 18:08:30 CEST 2022


On 19/04/2022 16:51, Joseph Wright wrote:
> On 19/04/2022 16:46, Philip Taylor (Hellenic Institute) wrote:
>> On 19/04/2022 16:35, Joseph Wright wrote:
>>> [...] Also at the macro level we can catch some 'hidden' resets,
>> /*Although*/ at the macro level ?
> 
> Yes :)
> 
>>> As it stands, I can't risk using the multiple stack approach, which 
>>> is a real shame.
>>
>> So how do you propose that this be addressed, and by whom (i.e., which 
>> team(s), not which individual(s)) ?
> 
> I hope that the maintainers of dvipdfmx will be able to look at it. I 
> have not checked in the code, but I suspect that the fact that one can 
> currently use
> 
>       \special{color push <name>}
> 
> and
> 
>      \special{pdf:bc [<array>]}
> 
> means that internally the two are represented in the same way. dvipdfmx 
> outputs the value of these colors in PDF format, so I imagine that the 
> conversion could be done *before* adding to "stack 0", which would then 
> take these legacy value or direct usage with PDF specs as equivalent.
> 
> If there is no chance of anyone else looking, I will try to find a way 
> to do this in the code myself. However, I really don't programme in C, 
> so it will be a largely copy-paste effort.
> 
> Joseph
> 

Reading back, it occurs to me that although it's not in the current 
manual, there was an addition to support stroke and fill color

     \special{pdf:bc fill [0 0 1] stroke [1 0 1]}

Whilst that doesn't quite do the same as multiple stacks allow, it does 
allow stroke color to be handled, at least for the main stack. I will 
pick up that idea in some backend code for the present.

Joseph



More information about the dvipdfmx mailing list.