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;
{ INITIAL;

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.