Editing Alignment Zones via Python in Glyphs 3

Hi there! I’m updating some of my own scripts from Glyphs 2 to Glyphs 3.

I am getting some attribute errors when I try to modify the alignments zones of a master. Are they now stored as a tuple?

How would one remove, and add, alignment zones via Python in Glyphs 3?

Thanks!

CC @GeorgSeifert @mekkablue

There are no alignment zones any more. The info is now in the metrics:
The documentation for how that works is not really good, yet. I’ll add some examples in the docu.

Thank you, please let me know when this is available!

The Python implementation in the wrapper will take some more time. Until then here some code that might help:

# Adding a "metric" 
master.setMetricPosition_overshoot_type_name_filter_(200, 16, metricsType, None, "script == 'arabic'")

(the metricType is an integer. The values you can find in GSMetric.h in Glyphs 3.app/Contents/Frameworks/GlyphsCore.framework/Versions/A/Headers/GSMetric.h)

# changing a metric
metric = font.objectInMetricsWithType_withName_filter_(metricsType, name, filter)
metricValue = master.valueForMetric_(metric)
metricValue.position = 123
metricValue.overshoot = 21