[XeTeX] Typographic consistency (was: CJK and ideographic font names)

Jonathan Kew jonathan_kew at sil.org
Mon Sep 13 21:58:27 CEST 2004

On 13 Sep 2004, at 3:05 pm, Ross Moore wrote:

>>>   2.  Your source needed to be adjusted to replace gobbled spaces:
>>>       e.g.         \textipa{N\^O Oi lêi}
>>>       must become  \textipa{N\^O\ Oi lêi}
>>>   3.  the \oldstylenums  still uses CM fonts.
>>>       I used Hoefler Text  in this example; what font is better ?
>>> Jonathan, the gobbled-spaces are due to making letters have
>>> an active \catcode , I think.
>> That's a bit odd. Merely making them active shouldn't cause 
>> space-gobbling; I wonder if we can fix this by adjusting what the 
>> active letters expand to.
> Yep; you're right.
> I've already found a solution.
> The gobbling seems to be ultimately due to \char .
> All (well mostly) the macros in  utf8accents.sty  expand
> to give  \char"xxxx .
> When the next token is a space, this gets gobbled.

Yes, it would: standard TeX scanning rules say that it will consume one 
(optional) space after a number. When the \char.... that results from 
the utf8accents macros actually reads its argument, it will quite 
happily read beyond the digits that were part of the same macro 
definition. In fact, if the next thing happened to be another digit, 
you'd get a completely different character!

> So I've appended an extra \relax  in some cases.
> Now the space is preserved and results in the correct
> word-separating space.

I believe the most efficient thing to do is to explicitly include the 
optional space in the macro, but that can look rather odd, so I would 
often prefer \relax. Any macro whose expansion ends with a number that 
TeX will scan for its numeric value may need this kind of precaution. 
You might want to add \relax (or space) in all cases, not just some.


More information about the XeTeX mailing list