[XeTeX] Automatic font switching

Jonathan Kew jonathan_kew at sil.org
Sun Mar 30 22:56:15 CEST 2008


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.)

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.

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.

JK



More information about the XeTeX mailing list