[XeTeX] Automatic font switching

nico nicolas.marsgui at libertysurf.fr
Mon Mar 31 22:26:58 CEST 2008


On Sun, 30 Mar 2008 22:56:15 +0200, Jonathan Kew <jonathan_kew at sil.org>  
wrote:

> On 30 Mar 2008, at 7:38 pm, nico wrote:
>
>> Hello,
>>
>> Is there a way with xetex to define several fonts for several
>> ranges of
>> unicode characters, so that you don't need to put \fontmain for
>> each part
>> of a document handling a language needing a specific font (like CJK
>> languages)?
>
> With xetex 0.997 (current svn version, also shipping with MikTeX and
> some other packages; will be in this year's TeX Live), you can use
> the inter-character tokens feature to do this. (Check the mailing
> list archives, and look for the zhspacing package as an example of
> this.)

Thanks for the reply. Does the whole picture is in these macros?

\XeTeXcharclass
\XeTeXinterchartoks
\XeTeXinterchartokenstate

I've understood the first two ones. What's the use of  
\XeTeXinterchartokenstate?

> It's difficult to do a completely "universal" built-in solution to
> this, because of characters (especially punctuation) that are
> "shared" between multiple scripts, but ought to be rendered in the
> appropriate font depending on the context where they're used. But for
> specific kinds of documents, or limited collections of Unicode
> characters, you can do it at the macro level.

Ok.

> This kind of feature has been requested several times, and it's
> possible that some day we'll have additional built-in support
> (besides what can be configured via interchar token insertion), but
> there are no specific plans at the moment.

Ok. I guess that some higher level macros could be interesting. The  
zhspacing package already defines such kind of macros (\newclass,  
\setinterclasstoks, etc.) where character classes are named. Just a  
thought.

Regards,
BG


More information about the XeTeX mailing list