[XeTeX] "Options for all fonts" : colo[u]r, and the transparency byte

Jonathan Kew jfkthame at googlemail.com
Mon Jun 6 15:09:36 CEST 2011


On 6 Jun 2011, at 13:30, Philip TAYLOR (Webmaster, Ret'd) wrote:

> 
> 
> Jonathan Kew wrote:
>> 
>> Phil, the issue you're having is that the xetex option to specify transparency as part of the font colour does not use \special{} commands, it's an extra font property that is only supported by the (Mac-only, not-really-supported) xdv2pdf driver. Currently, at least, the xdvipdfmx driver - which is your only option on non-Mac systems - doesn't implement this.
>> 
>> On the other hand, it is *also* possible to specify transparency via PDF \special{}s. That's what I presume TikZ does, and apparently it works with xdvipdfmx. So you could do the same thing for text in plain xetex by writing the appropriate \special{} commands in your document. (But no, I don't know any details of exactly how to do that - sorry!)
>>   
>> 
> 
> OK, thank you for the explanation.  But may I ask a couple of
> questions, without wishing to seem unreasonable ?  Given that
> xdvipdfmx is now the default driver for XeTeX, and given that
> the xdv2pdf driver is both Mac-only and "not really supported",
> would it not be possible for you to enhance XeTeX to take advantage
> of the features that xdvipdfmx offers and thus emit the necessary
> PDF \specials when transparency is called for in the font declaration ?

In principle, yes; in practice, I don't have any time to work on that for now. Actually, I think the best approach would be to enhance xdvipdfmx to recognize and handle the transparency element of the font-colour attribute, rather than to make xetex "magically" insert \specials. Also, it would best be done by someone with more PDF expertise than I have.... maybe ChoF would be willing to look into it?

> 
> As a work-around, I am more than happy to insert the \specials
> by hand, but how do I find them ?  There is neither a DVI file on
> which to launch DVItype, nor does there appear to be a PDF 
> equivalent called PDFtype.

Possible approaches: You could try creating a similar file using regular (La)TeX and TikZ, so that you can then dump and investigate its DVI output. Then insert equivalent \specials into your xetex job. Or you could dig in to the output driver code that TikZ uses to see what \specials it generates; or look at the DVIPDFMx documentation to see what it supports, perhaps in conjunction with the PDF spec (as I expect the mechanism basically involves inserting fragments of raw PDF code at strategic places in the output stream).

Sorry I can't be more specific..... I don't actually know "the answer", these are just ideas I might pursue if I were trying to figure it out....

JK




More information about the XeTeX mailing list