[XeTeX] selecting feature in Devanagari MT with fontspec

Will Robertson will at guerilla.net.au
Fri Aug 5 10:03:55 CEST 2005


Yves wrote:

> If I run Jonathan's "AAT-info.tex" on font "Devanagari MT" I get  
> the following:
>     Conjuncts [1]
>         Additional Conjuncts [4]
>
> But if I write:
>     \newfontinstance\devanagarifont[Conjuncts=Additional Conjuncts] 
> {Devanagari MT}


AAT-info gives the XeTeX-level string to give those font features,  
for use with the \font primitive:

    \font\1="Devanagari MT:Conjuncts=Additional Conjuncts" at 12pt

Because these can change between different fonts, it was a nightmare  
trying to keep track of what string to use with what font, which is  
why fontspec was invented. But I certainly cannot add every font  
feature ever used, although I try and include as many as I can, so  
fontspec provides you with a means to extend its feature set:

   \newfontfeature{MoreConjuncts}{Conjuncts=Additional Conjuncts}
   \newfontinstance\devanagarifont[MoreConjuncts]{Devanagari MT}

For more info (not that there's much), see section 5 on page 16 in  
the fontspec manual (v1.8a).

As it turns out, this is actually the "Rare Ligatures" feature, so  
you could bypass this step and instead write:

   \newfontinstance\devanagarifont[Ligatures=Rare]{Devanagari MT}

(The numbers in square brackets returned by AAT-info say that it's  
feature #1, selector #4; search through the fontspec source for {1} 
{4} to see how it's defined there if you're interested.)

This is a good example of how the same feature may be present with  
different names in different fonts.

Good luck,
Will



More information about the XeTeX mailing list