Delete previous letters while writing

Hi, I’m kind of inexpert in Glyphs. I’m making a font with contextual alternates.
I would like that in that font every letter removes the previous one and if I type a letter twice (for instance “AA”) it shows the contextual alternates that I’ve created before, so, the second version of that letter.

Examples:

“AB” = only “B”
“ABCD” = When I type A, I want to see A, when B only B, when C only C, when D only D.
“AA” = only “A(second version)” after having shown the “A(first version)”
“A(second version) A” = only “A(third version)”

Thank you so much
Isa.

There are limits, and it will be impossible to have this done universally, i.e., for any letter typed at any position. Are you sure a font is the best solution for what you want to achieve?

You could try adding a zero width glyph called “empty” and adding the AnyLetter class in the features.

lookup round1 {
sub @AnyLetter@AnyLetter by empty;
} round1;

And repeat the same lookup over and over again. But each time with a different name, e.g., round2, round3 etc.

And for the variations of the same letter, you would need to add a lookup or a feature BEFORE that, with a ligature substitution:
A_A.liga
B_B.liga
Etc. and make sure they are not in the AnyLetter class.

Thank you! I´m still trying it.
So much better using ligatures instead of contextual alternates, in my case. Thanks for the idea!

Hello again! I´m working now with ligatures and so much better! But now I´m looking for some rotation feature. Is there something like that for ligatures? I have tried to modify some codes (of calt rotation) but it never works, so maybe is impossible what I´m trying to do…

What I´m trying to achieve is this, but repeated to infinity, like a loop

sub A A by A_A.liga;
sub A A A by A_A_A.liga;
sub A A A A by A
sub A A A A A by A_A.liga
sub A A A A A A by A_A_A.liga
sub A A A A A A A by A.liga
sub A A A A A A A A by A_A.liga
sub A A A A A A A A A by A_A_A.liga
etc…

Thank yoiu again for the help!
(I dont know if I should have started a new topic or not, sorry)

You could work with lookups again.

lookup round1 {
	sub A A by A_A;
	sub A A A by A_A_A;
} round1;
lookup round2 {
	sub A_A_A A by A;
	sub A_A_A A_A by A_A;
	sub A_A_A A_A_A by A_A_A;
} round2;
lookup round3 {
	sub A_A_A A by A;
	sub A_A_A A_A by A_A;
	sub A_A_A A_A_A by A_A_A;
} round3;

And repeat as often as you need it, but each time with a new lookup name.

Hello again! I made some progress, but I haven’t achieved my objective yet.

Now what I have is this code:

lookup round0 {
sub A A by A.ss01;
sub A A A by A.ss02;
sub B B by B.ss01;
sub B B B by B.ss02;
}round0;


lookup round2 {
sub A.ss01 A by A;
sub A.ss02 A.ss01 by A.ss01;
sub A.ss02 A.ss02 by A.ss02;
sub B.ss01 B by B;
sub B.ss02 B.ss01 by B.ss01;
sub B.ss02 B.ss02 by B.ss02;
}round2;


lookup round2;
lookup round2;
lookup round2;
lookup round2;
lookup round2;
lookup round2;
lookup round2;


sub @anyletterA' A by empty;
.
.
sub @anyletterZ’ Z by empty;
(where @anyletterA is every letter except A)

When I’m typing, every letter substitutes the previous one. So, that’s ok, that’s what I want to do.
When I type two consecutives ‘A’, the second version of ‘A’ shows up in the same position as the first A. So, that’s ok too.

The problem is when I type some different letters, which works fine, followed by two ‘A’. The fisrt A subtitutes the previous letter (non-A) but the second one doesn’t subtitute the first A, cause that letter appears next to the one that was already there.

Thanks again for your help and support

Can you tell me what exactly you are trying to do? Why do you want to hide previously typed letters? An answer to that question would simplify my answer for you.

It´s an experimental (and non alphabetical) font, but not to sure if it´s achievable…
I´m trying to create animations with ligatures and the letters themselves.
And I would like to do this font using solely the font software…

Do you think is there any possibility?

Thanks!

so you basically add one frame with every typed character?

Yes, totally. The point is that there is a vinculation between each letter and each frame/illustration. They are not random dingbats placed in each letter

How many frames on average? My experience is that you can have a handful of steps before it gets too complicated or simply unfeasible.

And also: where should the font work? InDesign? TextEdit?

I´m working with three frames (ligatures, substitutions) per letter but I want them to work as a loop when you type the same letter many times.
So I have from A, A_A, A_A_A… to Z, Z_Z, Z_Z_Z.

At the best case I would like to use the font in Text Edit, but I am considering other options like Flash.

You usually can only have a small number of loops. Depends on the number of animations you put in.

Does Flash support OT features at all?

I recommend you concentrate on getting it to work in TextEdit. But make sure you have read and understood this first:

Basically, a lookup (like ‘ROUND1’ in the example above) takes the result of a previous lookup. Create one lookup that starts with the first frame, and results in the first frame again. Then, copy and paste the lookup and change its name. The number of lookups is equal to the number of loops.

You may also try just calling the lookup, like in the example above, ‘lookup round2;’, but sometimes this does not work, and you have to copy and paste the full lookup and change its name each time.

Thank you so!

Yes, I´m saving the fonts with differents names in the adobe fonts folder.

The problem now is that I can´t find the way to combine the alternates glyphs (which work as animations) and the letters. Cause at this moment I can do it separately but when I try to do both things it never works.

That means (sorry this is a mess and my english does not help):

ABCD (When you finish to type, in the screen you only see “D”): Works fine cause every letter substitute the previous one (I used the empty space that you told me, thanks)
BBB (“B”): Works fine and you see B_B_B.liga my third glyphs per B
AAB (“AB”): Not work
BBAC (“BC”): Not work, and this is even more weird cause when you type the “A” the second glyph of the B is deleted (with the empty space) letting us see the first B.

I think so, When I tried it the alternates appeared

At this stage I can sacrifice the loops and create a long code like this, doesnt matter:

sub A A by A_A.liga;
sub A A A by A_A_A.liga;
sub A A A A by A
sub A A A A A by A_A.liga
sub A A A A A A by A_A_A.liga
sub A A A A A A A by A.liga
sub A A A A A A A A by A_A.liga
sub A A A A A A A A A by A_A_A.liga
..etc

but I really need that all the letter and the differents glyphs stay together…

Thanks again!