OpenType Features?

Hello, i’m trying to write a feature that would sub something after enter (break of line)…

how can i achieve that?

Opentype features do not work over multiple lines. You only can query for the beginning or end of the line. But not if there is another line befor or after.

Thanks, how could I refer to the end/beginning of the line than?

With an ignore statement, approximately like this:

lookup beginningOfLine {
    ignore sub @All @All';
    sub x' by x.firstinline;
} beginningOfLine;

You can add an @All class (containing all glyphs) via the plus button in the bottom left corner of File > Font Info > Features.

For more tricks like this, I recommend reading Tal Leming’s OpenType Cookbook.

I also found out there is something like

Final Glyph on Line Alternates
Replaces final glyph on the line with an alternate.

but I’m not sure now to use it…
What I’m trying to achieve is to have a hypen.alt at the end of line if finished by capital letter…

Thanks …


I created falt feature in Glyphs panel with a command
"@big = [A B C D E F G H I J K L M N O P Q R S T U W V X Y Z];
sub @big hyphen’ by hyphen.alt;"

and it’s working in Glyphs but I’m not sure how to use it in InDesign…
Any Ideas?

I’m pretty sure the feature is not implemented in Indesign.

I see, I also wrote on InDesing forums, waiting for the answer.

I assume there’s more features like this… My question is than, why were those created? Is there any more advanced “text editor” for playing with opentype features than indesign? How this could be solved differently?

Maybe inside InDesign script could help?

These are registrations, reserved for potential future use. No one can force app creators to implement them, but implementation is changing rapidly as we speak. Read this text:

Thank You, I will read through.
I found out falt function is for West-Asian scripts.


I found 2 solutions and they are really simple.
1st one (not the best) is to just create calt function
"@big = [A B C D E F G H I J K L M N O P Q R S T U W V X Y Z];
sub @big hyphen’ by hyphen.alt;"

and the 2nd is to create GREP style inside InDesign :wink:

Some features might work in Indesign if you activate the World Ready Composer.