Script to use different stylistic sets within a text to cause variance

Is there a way (script/code) that the typeface would know that there is a specific letter that is being used throughout the text and that every time it is repeated to use a different stylistic set?

The image shows the Heh-ar.init used and Here I changed it manually for many letters (selecting the glyph in indesign). Is there a way for it to do this on its own so the user has this hand writting feel?

You cannot analyse the text in OpenType. All you can do is cycles of pre-determined substitutions that look random. OpenType Cookbook has examples on how to do it:
https://opentypecookbook.com/common-techniques/
But it means you need to have alternates for all glyphs, which may be too much. Maybe you could select the conditions randomly like this:

sub dal-ar space heh-ar.init' by heh-ar.init.ss01;
sub heh-ar.init' yeh-ar by heh-ar.init.ss01;
1 Like

You may also find the Advanced Contextual Alternates tutorial useful.

1 Like

would be too much, since its not only the heh it has multiple ayn and multiple kaf so that would be too much.

But the standard approach requires that you have the same number of alternates in all letters (and all initial, medial, and finals). I would say THAT is too much.

1 Like

Agreed!