[XeTeX] Proposed change in color handling
Stephen Moye
stephenmoye at mac.com
Tue Jan 3 14:20:57 CET 2006
On Monday, January 02, 2006, at 08:34AM, Jonathan Kew <jonathan_kew at sil.org> wrote:
>I'm considering making a couple of changes to how color is handled...
>
>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.
Agreed, absolutely. The only thing I would like to see in specifying
font color attributes is making it consistent with how colors are specified
in dvips. Instead of
\font\icky="Hoefler Text Black:color=FFFF00"
perhaps something like
\font\icky="Hoefler Text Black:color=rgb 1.0 1.0 0.0"
>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.)
Again, excellent idea.
More information about the XeTeX
mailing list