[XeTeX] Color and fonts

Jonathan Kew jonathan_kew at sil.org
Wed Apr 21 14:20:28 CEST 2004


On 21 Apr 2004, at 1:00 pm, <stephenmoye at cox.net> wrote:

> I sent this inquiry elsewhere when I should have sent it here. My 
> apologies.
>
> 1. With version 0.4 there are new color facilities: 
> x:textcolorpush/pop and x:
> rulecolorpush/pop. I'm sure I'm missing something very simple, but how 
> is
> color invoked in the first place and how are push and pop used, ie 
> what is the
> format of the \specials?

\special{x:textcolor=XXXXXX} where XXXXXX is a 6-digit hex value 
representing an RGB color. \special{x:textcolor} will reset to the 
default color, normally black but not if a "color=XXXXXX" option was 
used in the \font command (see some of the sample files for instances 
of this).

\special{x:textcolorpush} pushes the current setting onto a stack; 
\special{x:textcolorpop} restores it. (So you can change to a new 
color, and later restore the old one without having to explicitly 
remember it in TeX code. Could use in conjunction with \aftergroup, as 
one example.)

Similarly with \special{x:rulecolor=XXXXXX}, and corresponding push/pop 
specials.

>
> 2. OTF fonts (eg Adobe and Linotype): Is there a way to use these?
>

If they're installed in Mac OS X (i.e., within /Library/Fonts or 
another standard location), so that OS X applications can use them, 
then they should be available in XeTeX as well. Just say
	\font\myfont="LucidaSans-DemiItalic" at 12pt
or whatever. One tricky part: the name here is the font's PostScript 
name, which may not be identical to the name you normally see in a Font 
menu or dialog.

This will use the installed .otf fonts directly in XeTeX, not requiring 
(or using) any corresponding .tfm files or anything. However, note that 
you won't get specifically OpenType features such as automatic 
ligatures that are defined by GSUB tables; things like this will only 
happen if there are AAT tables present. This is entirely dependent on 
what Apple supports through the ATSUI APIs.

It's also possible to use .otf fonts in conjunction with .tfm files, as 
is done for the CM fonts right now, but there are issues with font 
naming and mapping that can make this difficult. Rather than spend a 
lot of time writing up the current situation, I hope to improve it 
soon. :-)

Jonathan



More information about the XeTeX mailing list