# Narrow shoulders of m
glyph = font.glyphs['m']
glyph.layers[0].components[1].smartComponentValues['shoulderWidth'] = 30 # First shoulder. Index is 1, given that the stem is also a component with index 0
glyph.layers[0].components[2].smartComponentValues['shoulderWidth'] = 30 # Second shoulder. Index is 2, given that the stem is also a component with index 0
I am always a bit confused with the SC API, there was also something with pieceSettings and partSettings … anyway
How can I set the value?
And if it’s different from the documentation, the documentation might need an update
The docu could also need an update where the examples use font or layer instead of Font or Layer, so that novices can use them quicker.
Ah thanks, sorry, there was indeed a lowercase mistake on my side.
But I managed to update the file where It still does not work. We tested now on different macs in 3151 and 3180.
This file now has 2 Smart Glyphs (marked red) with slightly different settings)
_smart.test.FAULTY is used in “D”, _smart.test.FAULTY.TEST is used in “E”
(Sorry for the names, we tried a lot of things to reproduce it and once we had the thing that fails, we did not want to change a thing, in order the keep the file “faulty”)
run this script with either D or E for the glyph to affect, and it does not work (here)
Weird, it does not work here. Also today not. But thanks for checking!
Edit:
For the record, after some debugging with Georg, we found that you need to save, close and re-open the file after adding a new Smart Component property. So it all works, generally