[XeTeX] local forms

Jonathan Kew jonathan_kew at sil.org
Fri Sep 22 15:49:36 CEST 2006


On 22 Sep 2006, at 2:37 pm, Pablo Rodríguez wrote:
>
> In order to get its legacy encoding when working with Greek, babel  
> adds
> two commands \greektext and \latintext (which I have to empty in order
> to use them with XeTeX).
>
> I guess all it should be done is redefining these commands so that  
> they
> will be able to switch scripts. Is it possible to switch the script
> without having to select a font?

There's no built-in way to do this at the "primitive" xetex level;  
the OpenType shaping behavior is dependent on the script and language  
settings which are part of the \font specification. So you'd be  
dealing with two unrelated \font identifiers, which happen to load  
the same font but with different "script=xxxx" settings.

Within LaTeX, you could probably do this with fontspec's  
\addfontfeature, though this will be less efficient than predefining  
separate font instances if you have a lot of switching back and forth  
(as it has to rebuild the complete font description each time). So  
something like this might work (untested):

   \def\greektext{\addfontfeature{Script=Greek}}
   \def\latintext{\addfontfeature{Script=Latin}}

These should be OK if you use them within groups/environments, so  
that the feature gets reset when the group ends; you don't want to  
continually switch back and forth without using grouping, as the font  
descriptor would get extended each time!

JK



More information about the XeTeX mailing list