Contextual alternates

Is there a way to make one set have a higher spawn ratio than another? (Without having to duplicate sets)


What is a spawn ratio?

I mean if it is possible to make a stylistic set appear with more percentage than another.

Percentage of what? Larger scale?

You can do two things with open type features:

  • reposition a glyph and it’s advance width (with a pos statement)
  • substitute a glyph (with a sub statement)

You cannot scale a glyph with OpenType features. That would require a separate glyph and a substitution. Or better solved in the layout app.

Sorry, I didn’t explain myself well. I mean when we do contextual cycling if there is some way within the code that one set appears more than another. Something like:
Set 1: 50%
Set 2: 25%
Set 3: 25%

I have followed these explanations:
And so I wonder if it is possible to go a little further.
I hope I have explained myself better.
Thank you!

…so AABC rather than ABC. (Not sure why you would want to do that, because it will create an AA, i.e. two identical glyphs next to each other.) It just depends on the context in which you substitute for the B. It can become complex if you allow interruptions like in the sample. So YMMV.

Well, the objective is that the letters are mostly from set 1 and those from the other sets appear randomly in a smaller proportion.
So I was wondering if there is a way to do something like that without the need to duplicate identical sets.
Like: 1121131121
Sorry for the mess.

Yes. You need to adjust the context accordingly. So you will sub @set1 @set1 @set1' by @set2; rather than just sub @set1 @set1' by @set2;. If you have interruptions and three cycles rather than two, it can become pretty complex.

Other option is to ignore (some) interruptions. Then naturally, you will have more of the default set because any interruption will break the cycle and it will start with the default again.

Thanks! I’ll see how to figure it out then.