[XeTeX] AAT feature codes

Jonathan Kew jonathan_kew at sil.org
Sat Oct 16 13:46:26 CEST 2004


Hi Will,

On 16 Oct 2004, at 12:21 pm, Will Robertson wrote:

> This page on the Apple website
> http://developer.apple.com/fonts/Registry/index.html
> shows all of the AAT features supported as of 1996 or something.

Well.... sort of.... it shows the "registered" features, but font 
developers are free to support additional features, and many AAT fonts 
do in fact use features and selectors that aren't in Apple's list. (For 
this reason, BTW, I'd like to see your package allow users to pass 
arbitrary feature names as options to typespec, not only a predefined 
set.)

>  I assume it's still correct (seems to be). At the bottom it shows the 
> numerical codes for each feature:
>
> <snip>
>    ligaturesType = 1,
>       requiredLigaturesOnSelector          = 0,
>       requiredLigaturesOffSelector         = 1,
>       commonLigaturesOnSelector            = 2,
>       commonLigaturesOffSelector           = 3,
> <snip>
>
> This implies to me that choosing the third selection of the first 
> feature will turn off Common Ligatures. (And so on with these types of 
> things: even means on, odd means off.)

Yes; the rule (for non-exclusive features) is that the selector values 
to enable each option must be even, and adding one to the "on" values 
gives "off" values.

> But in XeTeX I see something different - it turns on Common Ligatures 
> for both 2 & 3. The sample file at the end (based on code you gave me 
> :) demonstrates.

To be strictly accurate, it returns the selector name "Common 
Ligatures" for both 2 and 3; you can't directly specify selector values 
to the XeTeX \font command. But if you then simply pass this name to a 
\font command, of course, you'll be turning it on, so I see what you 
mean.

> I can't tell if this a bug in XeTeX. If not, it's very easy for me to 
> work around.

Not really a bug, that's just how things work; the name of the selector 
is "Common Ligatures" whether you're talking about the "on" value or 
the "off" value. The "!" meaning "turn off" isn't part of the actual 
selector name, it's a logical negation operator. :-)

So if you want to construct a XeTeX \font command based on given 
feature/selector pairs, you need to determine whether the feature 
concerned is an exclusive or non-exclusive feature (it's 
\XeTeXexclusivefeature or something like that; check AAT-info.tex). If 
it's non-exclusive, then odd selectors mean "turn this off", and so you 
need to supply the "!". But with exclusive features, there's no concept 
of turning a selector off, so this doesn't apply.

I suppose I could make \XeTeXselectorname prefix the name with "!" in 
this situation; currently, these commands are a very low-level 
interface to the ATSUI font name access functions, but I could put a 
wrapper around it to save you doing so in TeX macros. Perhaps....

HTH,

Jonathan



More information about the XeTeX mailing list