Contextual anchors

Another contextual anchors question: Is it possible to specify the order of application, such that more specific contexts run before less specific ones? i.e. if I have an anchor with context

fehDotless-ar.init.ain @ArabicDots * @KAFm

I would like that to appear in the feature code before another anchor with a more general context:

fehDotless-ar.init.ain @ArabicDots *

I was thinking about that. I decided against it as it would probably need a better UI (not only that single text field) to be useable.

What would be the full string?

Not generally. But if it would be on the same anchor (and we decide to implement this), then the order should be preserved.

That was a separate question: two different anchors, one with a specific context and one with a more general one. The specific one should go first.

how to determine specificness?

FWIW, this is not documented in Edit View: Anchors — Glyphs Handbook

Also the use of & to place mark name is not documented.

Both are very recent additions. There is still room for these to change until the 3.2 release which is when the Handbook will be updated to document the latest stable features.

1 Like

I’m having problems with contextual anchors. I tried both of these, but neither of them is switching the anchor when followed by one of the medialRa glyphs:

Screenshot 2024-05-09 at 08.51.47

Screenshot 2024-05-09 at 08.52.00

I also need to have several contexts, did this get implemented yet?

Also this contextual anchor is not being written into the mark code, I need the first mark (the righthand one) to move a bit further to the right when there’s the second mark (the left side) so the marks don’t overlap.


Screenshot 2024-05-10 at 09.08.19

The funny thing is, it worked a few times when exporting, but then stopped after I moved the anchor on the left side.

v3306

Now in 3306 it seems to be always switching belowmarks to that * anchor regardless of the context

Sovichet mentioned the anchor names might be the problem, as I’m using *bottomright in this case, not *bottom or *top. And my medialYa has its own anchors *medialYa, which isn’t working at all. Could the compiler for contextual anchors include arbitrary names?

You can double check the output in the Temp folder, and see what it made of it.

The order of the mark lookups in the feature file was wrong. It is fixed in the latest cutting edge version.

1 Like

I tried in 3307 but unfortunately it’s still not using the contextual anchor here, what have I done wrong?

Screenshot 2024-05-28 at 10.04.22

Screenshot 2024-05-28 at 10.05.03

Can you send me the font and the sample string?

Thanks, just emailed it

This one is now working.

I still didn’t see an answer about this?

EDIT Also, how can we specify to use the contextual anchor with certain marks, not all marks? Here I want to use the contextual anchor only with the iMark, not other marks, occurring before a medialRa, but this context doesn’t work:

Screenshot 2024-06-12 at 13.31.30

I thought you ought to be able to do that comma-separated. Or with multiple anchors (just keep adding asterisks to the anchor names).

Haven’t tried that, but theoretically you should be able to prefix the context with:

 lookupflag UseMarkFilteringSet [iMark-myanmar];
1 Like

Thanks Rainer! I can’t get multiple contexts working with a comma (or a semicolon), it just generates an error on export

I’ll try adding extra anchors. These glyphs already have quite a lot of anchors so I’m less enthusiastic about this approach :wink:

EDIT Not working with **anchor and a different context, but it does work when I put a .suffix on the contextual anchor name.

Why didn’t I think of that! It works fine! Thanks :smiley:

EDIT Ahhh, this isn’t going to work when there are other abovemarks in the context. The mark filtering flag needs to be broader than just the mark I want contextually positioned.

You can put more marks between the square brackets, separate glyph names with spaces, as always.