Ligatures in Style Sets?

Nick Cooke's picture

Is it possible to have ligatures that work only in selected style sets?

I have a script font that has a style set with an alternate r, but certain combinations need to be ligated - wr and cr in the example below. I only want the alternate style ligatures to appear in the style set. Can this be done?

The way wr and cr should appear is the bottom image.

Thanks.

Jens Kutilek's picture

Sure it can be done.

in ss01:

sub r by r.ss01;

in liga:

sub c r.ss01 by c_r.ss01;

The order of features is important. This only works if ss01 comes before liga, as it is in your screenshot.

Nick Cooke's picture

That's done the trick!

Vielen dank für ihre hilfe Jens.

Nick Cooke's picture

Now all ligatures work except rr. Could it be because it is two r's? It follows the same method as all the other ligs.

k.l.'s picture

If you followed Jens' logic, then your ss01 feature already has replaced all "r"s by "r.ss01"s. This means that
     sub r r.ss01 by r_r.ss01;
would not work because there is no "r" left in the glyph string handed over to the ss01 feature. Instead you need to replace two consecutive "r.ss01"s
     sub r.ss01 r.ss01 by r_r.ss01;

Nick Cooke's picture

Thanks Karsten, that fixed it.

charles ellertson's picture

Now that Nick's problem is resolved, I have a question: What is the argument against just putting the whole thing in a stylistic set? Ordering within the set would be important, but after substituting the individual glyphs, why not just go ahead and substitute the ligatures right there?

If you remember Wilson Greek, it came with an extensive set of ligatures -- I suppose you would call them historical ligatures. I built several stylistic sets, beginning with the most commonly seen ligatures (in, say, ss05), and making new sets with an ever-increasing number included. The thinking was that most authors wouldn't want all the ligatures; some are pretty obtuse.

It worked fine. I'll allow this is only for our in-house composition & not a for-sale font that has to work on numerous applications programs. Was that the only reason to involve the liga feature?

* * *

Example from the Wilson Greek

feature ss10 {
sub alpha' iota' @ENDS by alpha_iota.terminal;
sub alpha' uni1F77' @ENDS by alpha_uni1F77.terminal;
sub alpha' sigma' @ENDS by alpha_sigmafinal;
sub uni1F70' sigma' @ENDS by uni1F70_sigmafinal;
sub alpha iota by alpha_iota;
sub alpha sigmafinal by alpha_sigmafinal;
sub uni1F70 sigmafinal by uni1F70_sigmafinal;
sub alpha uni1F30 by alpha_uni1F30;
sub alpha uni1F31 by alpha_uni1F31;
sub alpha uni1F32 by alpha_uni1F32;
sub alpha uni1F33 by alpha_uni1F33;
sub alpha uni1F34 by alpha_uni1F34;
sub alpha uni1F35 by alpha_uni1F35;
sub alpha uni1F36 by alpha_uni1F36;
sub alpha uni1F37 by alpha_uni1F37;
sub alpha uni1F76 by alpha_uni1F76;
sub alpha uni1F77 by alpha_uni1F77;
sub alpha uni1FD3 by alpha_uni1FD3;
sub alpha uni1FD6 by alpha_uni1FD6;
sub alpha upsilon by alpha_upsilon;
sub alpha uni1F7B by alpha_uni1F7B;
sub alpha uni1FE6 by alpha_uni1FE6;
sub alpha uni1F50 by alpha_uni1F50;
sub alpha uni1F51 by alpha_uni1F51;
sub alpha uni1F54 by alpha_uni1F54;
sub alpha uni1F56 by alpha_uni1F56;
} ss10;

k.l.'s picture

Hello Charles, there is no argument against this. It depends on which kind of behavior you intend to achieve. So if you, as designer of a typeface, think that certain ligatures are essential part of a specific Stylistic Set, then you should include them there. If you consider the stylistic alternates as being independent of ligatures that involve these alternates, and want typographers to choose alternates and ligatures (whichever default or alternate shapes they may have) separatedly, you should deal with alternates in a Stylistic Set feature and with ligatures in the Ligatures feature.

Syndicate content Syndicate content