Final forms, space & punctuation

Hi all,

I’m trying to sort out some final forms. So far I have a and a.fina, which I believe is all I need. I have no initial or medial forms.

I’ve managed to use calt to get the last letter followed by a space to change to the .fina form:

sub a’ space by a.fina;

I now realise that I need it to work when the word is followed by punctuation. I’m pretty sure I need to use one or more lookups but am having trouble with this. I’ve read all of the tutorial on Positional Alternates and I think I know what the code needs to DO, but I don’t know HOW to write it.

So, instead of the simple code above, I need two lookups:

Lookup 1: Sub all a by a.fina
Lookup 2: Contextually change all a.fina when followed by another letter.

Can anyone assist with this code?

Thank you!

Don’t do this. Principally a bad idea to include space in your feature code because a renderer may not use the actual space glyph for composing the text on the screen. Hence, if you do it this way, your font will behave unpredictably across different environments.

Better to use an ignore statement. This is covered in the Positional Alternates tutorial:

This is called a contextual substitution and is covered in the Contextual Substitutions tutorial:

Ok thanks for the tip - I hadn’t considered that!

I’ve made three classes: @medial, @fina, @punctuation

lookup INITIAL {
ignore sub @medial@medial;
sub @medial’ by @fina;

This seems to work, even with punctuation which I haven’t included in the code. Can you confirm what I have is the best way to do this?

Ok so while the above code works it plays around with Ligatures.

If two (or more) individual forms are followed by a fina, they will substitute for the liga.
However, if the two or more forms are followed by a medial, they will not be substituted for the liga.

So I needed to use the @Allletters class:

ignore sub @medial@Allletters;
sub @medial’ by @fina;

Works for now!!

Again, this is explained in detail in the tutorial, but the ignore line means that the substitution (medial for final) will always take place EXCEPT for the context(s) described in the ignore line.

So, this example will always substitute a medial for a final unless it is followed by another medial.

Thanks Mekka, that makes sense. To make things more complicated - what if I was to have discretionary fina forms as well as standard, automatic fina forms?

If the automatic fina forms are in the fina class, and the discretionary fina forms are in the Allletters class, shouldn’t the following code work?

ignore sub @medial @Allletters;
sub @medial’ by @fina;


Perhaps my error is the naming of the discretionary fina forms, being a.ss01, b.ss01 etc…

They need to all be in the @AllLetters class.


17 @fina forms (the auto fina forms)
11 @fina1 forms (the discretionary fina forms)

So the @ Allletters class will have 17 + 11 + 26 = 54 glyphs.

This still doesn’t work :confused:

No. The class must contain all letters in your font. Best to automate it (i.e. activate the automation checkbox).