Does `.addMissingAnchors()` work for custom GlyphData?

I have a font which requires custom GlyphData.xml for a custom script.

(By the way, custom glyph definitions are super cool! This is my first time utilizing Glyph Info directly, and I don’t know how I didn’t know about it until just recently, or how I lived without it, often guessing at glyph naming or component requirements, etc. :sweat_smile: Anyway…)

My custom glyph definitions include anchors, including for a bunch of Mark glyphs.

I’m trying to “Set Anchors” for these custom Mark glyphs via a script, and it seems not to work.

The glyphs have -xx in their name, to indicate their custom script.

I’m trying the following code, and it doesn’t seem to work as expected:

# for glyph in Glyphs
for glyph in Glyphs.font.glyphs:

    if "-xx" in glyph.name and glyph.category == "Mark":

        for layer in glyph.layers:

            layer.addMissingAnchors()

However, using menu item Glyph > Set Anchors does work like a charm. Have a missed something in my Python script, or is this not currently possible?

Version: Glyphs 3.3.1 (Cutting Edge versions active)

Thanks for any insights!

the method “addMissingAnchors()” is only looking at the global glyph info. I fixed it. Until then use this:

layer.font().glyphsInfo().updateAnchor_(layer)

(In cases like this, you might find it interesting to look at the implementation of the wrapper in GlyphsSDK/ObjectWrapper/GlyphsApp at Glyphs3 · schriftgestalt/GlyphsSDK · GitHub)

Awesome, thanks, Georg!

I’ll take a closer look at the SDK, too.