Can’t get contextual mark attachment to work

Hello,
I updated to 3.2 (3197).
Having the same issue with contextual anchors.

Please resolve.
Thanks and regards.

Have you fixed your context? You have to write

reh-ar.fina *

Because the reh is before the glyph that gets the mark.

It still does not seem to work. Should I decompose the letters in ccmp beforehand?

So basically it won’t work unless you decompose the glyphs in ccmp. For example, if you need to move the dot below beh-ar.init when having reh-ar beforehand, you need to decompose beh-ar and beh-ar.init then add the contextual anchor.
It seems to work in FontGoggle but not in Indesign (even kern don’t work) my bad it was an old installation of the font in FontBook.

Yes. You can’t control individual components of composite glyphs using layout tables. To do so you need them as separate glyphs.

It should work in InDesign, make sure it is up to date and you are using World Ready Composer (and you are actually testing the new font not a cached old version)

1 Like

My bad, it was indeed an old version installed in FontBook.

One other thing, adding another mark will break the context.

You can add a mark filtering in the anchor context. Add lookupflag UseMarkFilteringSet @AnchorClass; before your context.

2 Likes

Thanks for your reply :pray:t2:
It kind of works, check the video below.
This is what I put in the anchor context:

lookupflag UseMarkFilteringSet @AnchorClass; reh-ar *

Demo here

You want the mark filtering set to include only the dot(s) below, so @AnchorClass should be replaced with something like [dotbelow-ar twodotshorizontalbelow-ar] etc (you can define a class in the features tab and use it here).

I don’t know what @AnchorClass includes, is this a magic class that includes all marks that has this anchor (this seems to be undocumented)? If so it won’t help here as it will include other marks below like the kasra that use the same anchor (it would work of dots used a different anchor than the vowel marks).

1 Like

I updated the class as you mentioned and it worked as expected. Thanks Khaled.

1 Like

I needed this again, so I worked to make glyphLib support it (PR not sent yet). I don’t know if inline contextual syntax is possible, but glyphsLib already uses explicit lookup references, so I went for that. The generated code looks something like this for a lookupflag UseMarkFilteringSet @dotsbelow; @reh * context:

markClass dotbelow-ar <anchor 73 282> @MC_dotbelow;

lookup mark2liga_1 {
    pos ligature behDotless_behDotless_ain-ar
        <anchor 730 -300> mark @MC_dotbelow
    ligComponent
        <anchor NULL>
    ligComponent
        <anchor NULL>;
} mark2liga_1;

lookup mark2liga_contextual {
    lookupflag UseMarkFilteringSet @dotsbelow;
    # @reh *
    pos @reh [behDotless_behDotless_ain-ar] @MC_dotbelow' lookup mark2liga_1; # *dotbelow_1
} mark2liga_contextual;
1 Like

Do the inline contextual ligature marks work? If so, what is the syntax for each part of the ligature? I’m trying to lower a mark on the first component of a 2-letter ligature if dipped letters come before, and using the anchor *bottom_1.low doesn’t seem to generate anything.

EDIT: After a little more digging it looks like perhaps not. Is there an OT hard-code workaround I could use to do this shift inside of the mark feature?

This does not seem to be currently supported by Glyphs. An alternative way is to add an with a different name, say bottom1, and add the feature code to use it manually:

lookup foo {
    pos ligature behDotless_behDotless_ain-ar
        <anchor
                ${behDotless_behDotless_ain:anchors.bottom1.x}
                ${behDotless_behDotless_ain:anchors.bottom1.y}
        >
        mark @mark_bottom
    ligComponent
        <anchor NULL>
    ligComponent
        <anchor NULL>;
} foo;

lookup foo_contextual {
    lookupflag UseMarkFilteringSet @mark_bottom;
    pos @reh behDotless_behDotless_ain-ar @mark_bottom' lookup foo;
} foo_contextual;
1 Like

That’s exactly what I was looking for, thanks!

I needed to put the first part up in Prefix, and then the context lookup call inside mark; otherwise the lowered location gets used regardless of context.

1 Like

You can also use the standalone keyword on the first lookup:

1 Like