Hello, thank you for reading this message seeking for help.
We use smart component to create Chinese characters.
I am wondering how to add anchors with the name of the properties to interpolating layers? Then I can add smart handles to smart component.It’s convenient to drag to make adaptations to shapes.
Sometimes I can add an anchor with the menu when right clicking.But that anchor seems not related to the component or shape.
Here is a little code snippet you can paste into Macro Window and run for all selected glyphs:
from AppKit import NSPoint
for selectedLayer in Glyphs.font.selectedLayers:
glyph = selectedLayer.parent
axisNames = [a.name for a in glyph.smartComponentAxes if not a.name in ("Width", "Height")]
for thisLayer in glyph.layers:
if thisLayer.isSpecialLayer:
for i, axisName in enumerate(axisNames):
if not thisLayer.anchors[axisName]:
smartAnchor = GSAnchor(axisName, NSPoint(0, -i*50))
thisLayer.anchors.append(smartAnchor)