[XeTeX] Turning off OT features

Peter Baker psb6m at virginia.edu
Fri Apr 10 00:22:37 CEST 2009


David Perry wrote:
> I'm fairly new to TeX and XeTeX, but have an extensive background in 
> Unicode and OpenType.  (Yay XeTeX!)  This may be a silly question, but I 
> haven't found the answer in the various docs I've looked at.
>
> I can turn on OT features easily enough:
>
> \addfontfeature{Style=Historic,Ligatures=Historical}
> same silly distant  \quad AA aa AY ay ag al
>
> which gives me long s and funky medieval ligatures when I use the 
> appropriate font.  The only way I know to turn the features OFF (so they 
> don't affect the entire rest of the document) is to put an extra pair of 
> braces around the whole thing, {\addfontfeature . . . al }
>
> This works OK, but is awkward when more than a line or two of text is 
> involved.  Is there a better way?  I tried some \begin and \end stuff 
> but that didn't work.
>
> Thanks - David
>
> _
David:

Look into \newenvironment. Declare the environment this way in the 
document prologue:

\newenvironment{funky}{\addfontfeature{Style=Historic,Ligatures=Historical}}{}

And now

\begin{funky}
blah blah blah.
\end{funky}

should do what you want. I think.

Cheers,
Peter



More information about the XeTeX mailing list