Full word alternate

Hey, I have just created my first font which has the whole Features, Part 3: Advanced Contextual Alternates tutorial which has helped me out a lot! But now I would like to make a full word always use the same alternates. Like the word Hello World, is this possible?

Help would be really appreciated!

That’s two words. What exactly should happen when you type what?

Well currently I have Hello World but with the different alternates it changes the way I want it to always look. Like the H changes with the e and the W and the l are different, I would like it to always stay the same when somebody types it and not use the alternates so make a new sub?
I hope I’m not being to confusing.

I read this now three times, and I have to confess, you lost me.

So, you want special alternates for some of the letters in “Hello World”, and they should only appear when the user types Hello World, and not in any other circumstances, like in Hell World or Hello Word or just Hello or just World.

Did I get this right?

Yes that is correct. So only when the user types “Hello World” and not in any other circumstances.

I think I fixed it I created a ligature for Hello and made sure that if you type that in combination with World it always stays the same.

My only question is now that if you add a space to a sub code it does not work and was wondering why, example:

sub hello.liga space W o r l d by world.liga;

And why can’t I make one ligature with a space in it? H_e_l_l_o_space_W_o_r_l_d.liga it gives me an error and overlaps all the letters over one another.

Sorry for all the questions.
Thank you for helping me out.

Can you post an image (or send it by email) of what you are trying to do?

So the first is what happens with all the alternate fuctions on.

But I always want Hello World to look like the following:
second H second o second W

So when you always type “Hello World” it will always be the same and not use alternate.

You don’t need a ligature, just specific letters, right?

Let’s assume the second H is called H.hello, the second o is called o.hello, and the W is called W.world:

lookup helloworld {
	ignore sub @AllLetters H', H' e l l o space W o r l d @AllLetters;
	sub H' e l l o space W o r l d by H.hello;
	sub H.hello e l l o' space W o r l d by o.hello;
	sub H.hello e l l o.hello space W' o r l d by W.world;
} helloworld;

I’m still not sure what you are trying to do. You have an automatic alternate feature but you like to disable it for a specific word?

Thank you will try this!
I assume there should be a class named AllLetters to create this.
I named all my alternate letters as x.ss01 would this be a problem?

Thank you! I will get back to you if it works.

I tried this but it didn’t work. I placed it in my calt features, or should I have made a new one?

lookup helloworld {
	ignore sub @DEFAULT H', H' e l l o space W o r l d @DEFAULT;
	sub H' e l l o space W o r l d by H.ss01;
	sub H.ss01 e l l o' space W o r l d by o.ss01;
	sub H.ss01 e l l o.ss01 space W' o r l d by W.ss01;
} helloworld;
  1. Instead of DEFAULT, use AllLetters, which can be auto-updated by glyphs. (Add the class in File > Font Info > Features.)
  2. Put it at the top of your calt
  3. Don’t forget to press the Compile button.
  4. Turn on contextual alternates in the Edit view.