In the GlyphsApi docs there’s a list of “methods”. In the macro window where I can play around with trial and error I can use the intersectPaths-method.
But when I try to use it inside my plugin, it looks like the intersectPaths-method isn’t known from within the classes I’ve declared to try and package it in different modules.
I’ve tried looking through the Font and Glyphs object, but I can’t see any “intersectPaths”-method, so I’m guessing it’s declared somewhere else. Is there some preferred way of using these “global” functions from within a Python plugin?
It is not clear from the linked documentation, on which object these methods are to be called.
I know for example that removeOverlap() is called on the layer. But that is not stated in the documentation.
But then, subtractPaths() and intersectPaths() are mentioned right behind removeOverlap in the documentation, but those are not called on the layer.
Could that please be clarified in the documentation?
Also: How to actually do the boolean operation nowadays? The method described here does not work:
AttributeError: 'GSPathOperator' object has no attribute 'intersectPaths_from_error_'
The issue with the documentation persists, though. The mentioned methods are located in a seemingly random location and it is not clear to the reader where they belong to. That needs fixing
Managed to make it work. These are class methods (now) so the GSPathOperator needs not to be instantiated.
Follow up question: Can one use one of the operator methods to use an open path to cut another path? Could not get make it work with any of the subtract or intersect methods.
So how is the standalone method to be called? I ask from the perspective of a user of the documentation. It is not really clear there. That was my point to ask if that can be clarified in the documentation.