Python testing using the Macro Panel

Today I was stuck on improving the Gradient Hatch effect to use global position instead of just making a gradient limited by the height of the shape itself.

To fix this I need to find the metrics object of the Font/Layer.

The “dir”-method wasn’t really helping, but looking around in the docs and comparing with the C-style header files got me some information, all though going back and forth between making changes to the plugin and restarting Glyphs was a bit tedious.

This is where the “Macro Panel” for testing Python Scripts came in handy where I could quickly run Python-scripts and check which methods or instance variables I needed to access to access the metrics values.

Hopefully I should have an updated Gradient Hatch method ready by tomorrow.

I was considering whether I need to take the overshoot into consideration or if I should just ignore it.

I’ll probably write the logic so that anything above the ascender is the starting/ending value and vice versa for anything below the bottom of the descender. There’s a bit of complexity introduced by the fact that there are negative Y-coordinates below the baseline and positive Y-coordinates above it, but I think the math should be fairly straightforward.