Contextual Lookups for Ordinals


I have this lookup for ordinals. It works OK for 1st, 2nd, 3rd, 4th, etc., and for Caps, 1ST, 2ND, 3RD, etc., but not for ordinals in French or Spanish, which use one or three ordinals e.g. 2º or 1ème.

How can I change my code to cater for one or more alpha characters after the digits? One to three superscripts would be OK, but I think one or more would be more flexible.

feature Ordinals ordn {
lookup Ordinals;
group @Digits [zero-nine];
group @Alphas [A-Z a-z];

lookup Ordinals{
context (@Digits) @Alphas @Alphas;
sub 0 Super;
sub 1 Super;
} lookup Super {
sub [A-Z] -> [uniEAA1 - uniEABA];
sub [a-z] -> [uniEAC1 - uniEADA];

I am using OpenType Compiler.

How do I script Swash letters, alternates etc.?


I've recently learned how to use Fontlab Studio 5, and I also learned how to script ligatures. But I noticed Illustrator for example has more buttons in the type tool section: Standard Ligatures, Contextual Ligatures, Discretionary Ligatures, Swash, Stylistic Alternates, Titling Alternates, Ordinals and Fractions.

So out of that list, I only know how to script the standard ligatures. Does anyone know how to script the others, or do you know a source to learn about it? Most font families contain all the ligatures and swash letters as seperate fonts rather than putting it into a single font (OpenType). Is there a reason for doing this?