Only make ligature when in between spaces

Hi! Is there a way to create a ligature only when in between spaces? I wanted to ensure that the characters the feature will be affecting form an individual word rather than as a part of another word.

With the ignore statement. See the positional alternates tutorial. The code you want is the one for ‘isolation’.

Thanks for the tip, @mekkablue !

However, I’m a bit stumped since the sample in the tutorial uses Classes that will require the tick marks. In my case, it’s composed of 2 characters [Mᜋ᜔ and GAᜄ → MGAᜋᜅ] that I’m merging into a ligature.

image

(I got away with the first one [NGᜅ᜔ → NANGᜈᜅ᜔ ] since it’s just one character to be substituted)

It doesn’t matter if you use classes or single glyph, the tick mark can be sued on both.

Yes, I’m aware the tick can be used in a single glyph! But cannot be used in 2 consecutive glyphs twice that make up a ligature hmm

:white_check_mark: sub glyph’ glyph by glyph;
:question:sub space glyph’ glyph’ space by ligature;

:question:ignore sub @AllLetters glyph’ glyph’…

Why not? I just tested in a random (Latin) font by adding the following substitution in liga:

lookup testsub {
  sub a b' c' d e f by five;
} testsub;

– and the result is exactly as expected: typing abcdef outputs a5def.

1 Like

Oh wow! I’ve always thought there needs to be an equal number of results on the other side, I didn’t know it’ll work for ligatures too! I’ll try this, thank you so much for your patience!

  1. You need the tick marks for the ignore statements. Take another look at the tutorial perhaps, it is described step by step there.
  2. Do not use the space glyph in OT features. Isolated word does not mean ‘surrounded by space glyphs’. Some renderers do not even use the space glyph.
1 Like

Noted on this :smiley: Finally got the code to work well! Thank you so much for all the help!

1 Like