[XeTeX] Proposed change in color handling

Jonathan Kew jonathan_kew at sil.org
Mon Jan 2 14:33:37 CET 2006


I'm considering making a couple of changes to how color is handled in  
XeTeX, and would appreciate hearing any comments from users before  
this is finalized. (I'm guessing that most people will be unaffected  
by the proposed changes, especially if using color via standard  
packages that hide the underlying \specials, etc.)

There are two potential changes I have in mind:

1. In addition to setting the color via \special commands, color can  
be specified as a font attribute, and then applies only to the  
specific font. Currently, color set via a \special will *override*  
font color, so the font color is only used if no color specials are  
present (or if the "special color" is reset to "default" using  
\special{x:textcolor=} with no color value).

The change I am considering is to make the font colors override  
colors set via \special, so that if a font has a color attribute, it  
will *always* use that color. Where no font color is given (the usual  
case), the text will follow the \special color values.

It seems to me that this is a more natural and intuitive model for  
the interaction between these two color-setting mechanisms, and it  
removes the need for a \special operation that resets the default  
color state.


2. As a result of how color support in xdv2pdf has evolved, there are  
currently two sets of color \specials available: xdv2pdf's original  
"x:textcolor" and "x:rulecolor", and the dvips-style "color". I'm  
thinking of removing the "x:..." specials, as with change (1) above,  
it should be possible to use the dvips-style commands for everything,  
thus ultimately making things simpler for package authors/maintainers.

However, as the current xetex.def driver for LaTeX graphics/color  
uses the "x:..." commands, this will need an update. I don't know  
what other packages such as ConTeXt may be using at the moment. So  
this is a heads-up to anyone who has written XeTeX support macros  
using the old \specials.... they may be retired (or at least  
deprecated) shortly.

(Why? Well, although xdv2pdf supports both types of \special, other  
drivers in the future may not. So it would be advantageous to move  
any existing macro packages from "x:..." to "color" so as to be more  
portable.)


Comments welcome,

JK



More information about the XeTeX mailing list