Inital forms not working in new line of text

Hello! Still relatively new to font-making here. I am working on a script font and have created initial forms for some of the lowercase characters. Everything is working exactly as I coded it to be, however, I have noticed that when one of the lowercase letters starts a new line of text it does not use the initial form. For example, the lowercase “r” is not using the r.init when a new line of text is started, only when it follows a space or other letter I’ve added to the coding in features. I’ve attached a screenshot. Is there something else I need to add in the features for this to work? Like “return” or something along those lines? Thanks!!

Screen Shot 2021-09-26 at 7.44.15 PM

Hello, first off, I have very little experience with coding script fonts, but wouldn’t it make more sense to have the r.init as the default glyph and code that it is substituted by the connecting shape if a letter precedes it?

Yes, that is definitely possible! I did this on my previous (and only other) script font and it worked, but it was a different style so I didn’t try that here. I’m still figuring a lot of this out so was just curious if there was a “right” way to do things.

Have you read this: Features, Part 4: Positional Alternates | Glyphs

I have read it, thanks! The issue I’m having is only when the new line of text is made, every other scenario works fine. It’s possible I’ve missed something in the code so I’ll go back and read again.

‘Only after space’ is rather poor definition of the condition as initial (it also doesn’t happen after quote or parenthesis). Better one is ‘if it’s not preceded by a letter’, like:

ignore sub @letter @initBefore';
sub @initBefore' .... by @initAfter;
1 Like

I’ve tested this code only using lowercase a and b which worked fine.

@anyLetters = [a b a.init b.init];
@base = [a b];
@init = [a.init b.init];

lookup init {
    ignore sub @anyLetters @base';
    sub @base' @base by @init;
} init;

Basically the same code as the previous though. If your problem persists, would you mind sharing your code here?

Thank you! I will try this.

Perhaps there was another substitution kicking in? Is this all your code? Which features were active in the screenshot?

It’s definitely possible some other substitution is kicking in. In the screenshot, there was calt, init, and liga turned on.

It is my code and it’s possible I missed something somewhere. When I have a little more time, I’m going to go back through and re-code it using that article mentioned above and see if I skipped a step somewhere.

…for now I just changed the r slightly to look better when it starts a new line of text :upside_down_face: thank you for the help!