Conditional anchors

Maybe a silly question, but I can’t get it:

By default, the three dots will be positioned like this.

but in this combination, the dots should be placed a little bit more to the right.
Is it necessary to use an additional character, or could they be positioned conditionally by feature code somehow?

Glyphs has contextual anchors. They are described in the Glyphs 3 announcement:

You probably know how Glyphs has been reliably and automatically creating mark and mkmk features based on your mark attachment anchors. Now there is a new twist to it: contextual mark attachment can be set up with special, asterisk-prefixed anchors again. Let’s take the bottom anchor in an Arabic sad-ar.init as an example. Let’s say, we want to move any bottom marks a bit to the left in case a preceding reh-ar reaches in from the right. What you do now is duplicate the bottom anchor and rename it to * bottom , i.e., you prefix it with an asterisk * , with or without a space in between. This is your contextual bottom anchor. Whenever a contextual anchor is selected, the palette sidebar on the right (Cmd-Opt-P) will display a section called Anchor Context at the bottom. And there, you can type your glyph context as you would in OT feature code, just with * as placeholder for the glyph, reh-ar * in our example. Since it is OT feature code, you can also type in class names, and even tokens:

If you need more than one contextual anchor, add an arbitrary dot suffix, e.g., *bottom.noon and *bottom.reh , and so forth.

2 Likes

Really nice! Thanks.

Hi Florian!
Just tired it, but it seems I did it not right…
Would you please advice.

You need to separate the * with a space in the Anchor Context field.

Still wont work :((

And the edit view doesn’t preview the context anchors. You need to use the Text Preview window or export the font and try in a browser or Adobe apps.

Hi Georg,
tried that already too. Same result:

What exactly did you type in Indesign.

The anchors work only for marks that are typed individually. If the string is “beh + hah”, the dot is in the beh and is not positioned by a mark. You would need to type “behdotless + dot below + hah”. Or use OpenType to decompose the “beh” into “behdotless + dot”.

I see no final hah before the beh, it is afterwards. So the OT feature context is * hah-ar.fina

I´m typing yeh-ar.init + hah-ar.fina
Probably thats why it does not work.

P.S. Type that separate behDotless-ar.init + twodotshorizontalbelow-ar + hah-ar.fina
unfortunately still dont work.

Can you send me the .glyphs and .indd file?

Many thanks Georg!! Files are in your Mailbox.

I just had a look at your file.
There are two problems.
First, the anchor name should not have a space after the *.
But is doesn’t seem to work for RTL glyphs. I’ll need to investigate.

Thanks Georg! I tried also with and without space before I wrote here. If that info helps…

I am trying the ( * bottom ) anchor coupled with ( glyphname * ) placed in the Anchor Context filed, but no result is happening.

Another question. Does this conditional anchor feature work only when a glyph is following another specific one, like ( رإ ، ريس) ? Or does it also work for a glyph when it proceeds another specific one? Like (أكتب) And I want to add ( *top ) anchor for the hamza to move up if the alefHamzaabove-ar is followed by a kaf-ar.init ?

And in which applications is this feature active when the fonts are generated?

Can you show you exact setup?

The code in the context text field can be set to whatever context you like. Maybe manually write the code in a feature until works as expected. And then put it in the anchor.

Here example of placing a Conditional Anchor for alef-ar to make the Hamza shift down in alefHamzabelow-ar after following a waw-ar.fina

Tested in Glyphs Text Preview, Adobe Indesign, and FontGoggles and the hamza is not shifting down and keeps overlapping with the waw-ar.fina.

And if I want to make the Hamza shift up in the alefHamzaabove-ar if followed by kaf-ar.init? What should be the code placed in the Conditional Anchor and in its Anchor Context field?

I am on Glyphs 3.1.1 (3139)

Can you send me the .glyphs file and the string that you tested?

Sent