Advice on using custom GSHints

Hello, for a plugin, I would like to use hints and their very handy functions. Basically, I want to annotate nodes in a UI (which will include more or less copying the hinting interface – I wasn’t able to find it in Glyhphs’ internal plugins). These annotations will indicate snapping behaviour (snap to baseline, retain distance to other node, things like that). In order for these annotations to stick to the same nodes from a design perspective, I would like to leverage the functions of GSHint, which do a very good job of keeping hints on nodes even when path direction changes, node indices change, etc.

How can I do this? Is this even possible? It’s already used for corner components, for the same reasons. I tried something like setting the hint type to 11, but that makes Glyphs hang.

Instead of using hints, you can use node.userData. It uses the same algorithm to keep the info attached to the node and is more flexible.

1 Like