Ligatures consisting of Default and Alternate Glyphs

Hey Guys.

I’m working on a gothic typeface were 11 Glyphs have different alternates.
And for the web implementation (because CALT’s aren’t really working) I want to
handle unliked letter combinations with ligatures.

The problem is that glyphs has trouble to build ligatures consisting of a mix
of one default and one alternate glyph.

Has someone dealt with a case like this before, and maybe has a good problem fixing
or workaround?

The confusing thing is if I try to add a new glyph for example A.ss04_N.liga Glyphs sets up a new glyph called A_N.ss04_ which I don’t really get. @GeorgSeifert can you maybe help?

Thanks in advance!

The part or the glyphs name before the first period has to match the typed text. So the name of a ligature of A and N has be “A_N”. Then you can add a suffix to that. So there are two options:

  • A_N.ss04: That would be an stylistic alternate of the full ligature glyph.
  • A_N.ss04_ss01: (note the extra underscore). This is a “ligature” suffix and denotes the suffixes of the base glyphs. So this would be a ligature of “A.ss04” and “N.ss01”. If one of the base glyphs doesn’t has a suffix, you leave it empty: “A_N.ss04_<empty suffix>”.

Your original name “A.ss04_N” would be an “A” with a “.ss04_N” suffix.

That Glyphs is eating the .liga suffix is a mistake. Please add it again after the rename. I wonder why calt is not working? And can you send a screenshot of the “A_N.ss04_” glyph?

1 Like

First of all hier is a screenshot of the A_N.ss04_ glyph, which normally should be called A.ss04_N glyph.

@GeorgSeifert I attached some screenshots to add more details to the problem. When I’m going to add a new glyph called I.ss01_M.ss01 and afterwards detach the glyph and then replace the M.ss01 with the default M. Everything seems to be fine but when I’m typing I.ss01 M.ss01 in the editor it won’t work. And I don’t understand either why glyphs automatically puts this into dlig and not in liga in the features.

You should not build ligatures! You need to fix your contextual code.

I already did a woff with calt but the developers say it won’t work. What I don’t really understand because it’s a simple css command. Do you have any experience with implementing a typeface with calt as opentype feature in web, by any chance?

Or besides ligatures any other workaround how I could avoid that two of the alternates follow up on each other?

Maybe because there are other text attributes like letter spacing in the CSS setting? (makes more sense in ligature features but who knows) Do all browsers fail?

I wouldn’t resort to an inadvisable option easily, but features like ccmp is a nuclear option. (note: it gets activated pretty early in the feature code, way before ssXX ones) If that doesn’t work either, the CSS code is definitely to blame.

You need to pay attention to the feature order.
As you show in the screenshot, the dlig substitution will never happen because the I.ss01 will be applied after the dlig feature. What difference should the ligature make? Can you show same example what you are trying to do?

Bildschirmfoto 2021-03-18 um 14.18.51

Okay got that. But every time I hit the update button, Glyphs re-organize the order again.
I attached this screenshot to show what I want to avoid with ligatures. The base typeface consists of gothic letters. Every glyph which is included in D O C O M E N T A F I F T E E N has 1-3 alternates. And I want to avoid that two alternates follow up on each other (implemented on the future website).

Earlier I also tried to get the same result using calt (which is in my opinion the better way to deal with this approach) but the developer was always replying that he couldn’t command calt via CSS, what I don’t really get what the problem may is. I also attached a screenshot of an earlier stage using calts.

Contextual alternates are not working? In which browser?

Yes, at least this is what the developer feedbacks us. I just said contextual alternates aren’t working (the communication is a bit tricky). Maybe there’s an error.
The first screenshot shows the feauture section and code of calt in the glyphs-file, the second screenshot the code if I open the woff/otf file again in glyphs. Or is this normal?

Don’t hit the button then. It is meant to establish default behavior but your code is too special. You can update the features one by one when clicking the circular button next to the feature name.

Your calt code doesn’t make much sense. You are replacing all kind of glyph combination with a single “N”. And it relies on the stylistic sets to be active. So is might be that the calt feature is broken in itself and not the browser support.

Again, can you explain what you are trying to do. Write it out in your own words. Something like: “if there is an A and a B, then use an alternate B …”. And should those alternate be applied automatically or should the user select the alternates one by one manually?

First of all thank you already for your responds and help!!

The typeface includes twelve stylistic sets. It’s that huge amount of stylistic sets because the editor later should be able to choose in the cms within different sets with different amounts of alternate glyphs.

What I want to do is to avoid that two alternates follow up on each other.
To take the example from the screenshot before (I’ve attached it again) in the word “DOCUMENTA” the M is M.ss07 followed by E.ss07, but I’d like that M.ss07 will be
followed by a default E.

Same counts for the second line “FIFTEEN”. The two “E’s” are E.ss07 but I’d like that the
second E.ss07 should be replaced by a default “E”.

Is this understandable?Bildschirmfoto 2021-03-18 um 14.18.51

Then you feature code is almost right. You need to add a “tickmark” behind the glyph that you like to change.

sub I.ss01 N.ss01' by N;

And you can combine them using classes:

sub [I.ss01 I.ss04 O.ss05 U.ss03 A.ss04] [N.ss01 N.ss02 N.ss11 ]' by [N N N];

Thank you very much Georg!! I’ll try that and hope that it will work out this time :slight_smile:
Thanks for the big time support!

Last question. Do I have to restructure the sequence in the features section, or is it correct as it ist. If set up the code based on your helping fragments. Looks good to me know.

As far as I can see, that should work. If there is only one glyph in a class, e.g. [H], you might as well leave out the brackets: H.

The contexts may clash to some extent. If you want one rule to take precedence over another, put them in different lookups:

lookup context1 {
    sub  [E.ss06 E.ss07] [N.ss01 N.ss02 N.ss11]' by [N N N];
    sub  [N.ss01 N.ss02 N.ss11] [E.ss06 E.ss07]' by [E E];
} context1;

Any lookup builds on the substitution results of previous lookups. All lookups are executed once, and in the order of their definition.

Tip: in a forum post, you can paste code between triple backticks ``` (three grave accents), then it will be code formatted like this:

sub [U.ss03 U.ss08]' H by [U U];

That makes it easier to find and read than in screenshots. If the first triple backtick is followed by the word ‘text’ (like this: ```text), then syntax colouring is suppressed.