[XeTeX] \beginL and colour
jonathan_kew at sil.org
Mon Nov 15 15:27:25 CET 2004
On 15 Nov 2004, at 8:56 am, Hans Hagen wrote:
>> Note that it should be possible to implement arbitrary text color
>> changes by using \fontname to retrieve the current font name, adding
>> a "color=...." attribute, and setting a new font. In this case, the
>> color is associated directly with the actual text characters, so it
>> will work properly despite the reordering.
> what rules apply for the font spec then?
See the XeTeX-notes file, and other samples. To summarize (somewhat
\font\cs = "FONTNAME(: ATTRIBUTE(; ATTRIBUTE)*)?" at SIZE
where FONTNAME is the "display name" of the font, as shown by FontBook
(for example), and ATTRIBUTE can be any of several things:
select script (shaping engine) and language system for OpenType
enable or disable individual OpenType feature tag
enable specific AAT feature/selector by name
set a color, with optional alpha channel
set value for a variation axis
So for example,
\font\redrm="Hoefler Text:Ligatures=Optional Ligatures;color=FF0000"
and so on.
Incidentally, I'm wondering if I should loosen up the font name parsing
to allow colon and semicolon to be interchangeable, so that you could
always add ":ATTRIBUTE" at the end of an existing font spec, without
having to worry whether this is the first attribute being added to a
raw font name.
More information about the XeTeX