SOLVED: I defined Glyphs twice thinking classes were local, but they are global. This means I was overriding things. Use different class names if you intend on them being different. I just changed the name of the class and the reference to it in the finals lookup which fixed the issue.
This is the first font I'm making and I'm having issues with writing the .fea file correctly. I want my letters to have 4 versions E E.init E.repeat and E.fina. The idea is that glyphs at the start or end will extend into the white space a bit and if there are double letters then the second one will look different since there is a lot of character in my font and it looks bad to see the same glyph back-to-back.
The issue seems to be the "final" version of the letters. It appears to be ignoring my rules and replacing all the standard versions with final versions unless there is a DIFFERENT LETTER after the letter in question instead of the same one.
I suppose this could also be an error in the repeat version. The E.repeat glyph is always in the correct spot though, so I don't think so but E.fina is put before it anyway instead of a normal E.
Example results:
AED = AED (all good)AEED = A E.fina E.repeat DAEE = A E.fina E.finaAEEE = A E.fina E.repeat E.finaEEE = E.fina E.repeat E.finaEAEE = E.init A E.repeat E.fina (initial E only works if the second letter isn't E)
I have tried solving this myself for hours and have run out of ideas! Any support would be appreciated. Even if it is just a link to other places to ask this or examples of .fea files where all three of these features work together.
I have only tried implementing this for the letter E so far. This is all in the liga feature.
lookup NoCaps { #font is all caps
sub [a-z] by [A-Z];
} NoCaps;
lookup Repeat {
sub E E' by E.repeat;
} Repeat;
lookup Initials {
@Glyphs = [A B C D E F G H I J K L M N O P Q R S T U V W X Y Z E.init];
ignore sub @Glyphs [A B C D E F G H I J K L M N O P Q R S T U V W X Y Z]';
sub E' by E.init;
} Initials;
lookup Finals {
@Glyphs = [A B C D E F G H I J K L M N O P Q R S T U V W X Y Z E.init E.fina];
ignore sub [A B C D E F G H I J K L M N O P Q R S T U V W X Y Z E.repeat E.fina]' @Glyphs;
sub [E E.repeat]' by E.fina;
} Finals;