I’m trying to write a plug-in now, and there are 2 problems about smartComponentValues occurred in my test.
The first is, Glyphs always crash when click the OK button in dialog when I add a smart component and set the smartComponentValues by scripting.
# Issue 1
layer = Glyphs.font.selectedLayers[0]
comp = GSComponent('_part.test')
layer.components.append(comp)
comp.smartComponentValues['Width'] = 50
comp.smartComponentValues['Height'] = 30
# Glyphs App crash here when open Smart Component Value dialog and click OK
# App will not crash if adjust size by mouse first
The second is, when I copy the layer, and run the code below in the new layer, component’s outward do not change (but it changed in script level).
# Issue 2
# Copy layer, and run the code in the new layer
comp = Glyphs.font.selectedLayers[0].components[0]
comp.smartComponentValues['Width'] = 80
print comp.smartComponentValues
# <GSNotifyingDictionary: 0x60000062c260> {
# Height = "46.79218682479114";
# Width = 80; <= in script base, the value changed exactly.
# }
# However, component in the UI is still shown as the original width.
# component do not change until set the value via dialog or resize by mouse manually
Glyphs version is 2.6.4 (1286).