[XeTeX] How to get _third_ stylistic alternate?

Jonathan Kew jonathan_kew at sil.org
Sun Apr 13 21:24:55 CEST 2008


On 13 Apr 2008, at 2:10 pm, Will Robertson wrote:

> On 13/04/2008, at 9:02 AM, Grzegorz Murzynowski wrote:
>> Jonathan Kew pisze:
>>> The 'salt' feature takes a parameter, which is the (zero-based)  
>>> index
>>> of which alternate you want.
>>>
>>>   \font\x="Garamond Premier Pro" \x \& \par % default
>>>   \font\x="Garamond Premier Pro:+salt" \x \& \par % same as next
>>>   \font\x="Garamond Premier Pro:+salt=0" \x \& \par
>>>   \font\x="Garamond Premier Pro:+salt=1" \x \& \par % second  
>>> alternate
>>>   \font\x="Garamond Premier Pro:+salt=2" \x \& \par % third  
>>> alternate
>> :-))))
>> “Ich Dummkopf!” (Me fool!) I was trying "+salt=3".
>
> I don't think I knew that!

Gotcha! ;-) Well, we can hardly blame you... OpenType features with  
parameters are pretty unusual (the only other ones you're likely to  
run across much are probably 'aalt', and 'ssty' in math fonts like  
Cambria Math).

> At the moment this would logically fit into the "Alternate=x"  
> feature of fontspec since "Variant" already covers the "+ss0x"-type  
> features. But if anyone has a better idea let me know :)
>
> Jonathan, is it possible to query how many 'salt' features exist in  
> the font?

No, sorry. (Strictly speaking, in OpenType terms it's a single  
feature; you mean how many alternates there are to choose from within  
that feature.) The answer can vary for each glyph that has  
alternates, anyway. E.g., in Garamond Premier Pro, some characters  
don't have any stylistic alternates; some have just one; and the  
ampersand (at least) has three. I expect there are probably some  
other chars with multiple variants, too, but I haven't examined the  
whole font.

JK



More information about the XeTeX mailing list