Hi, I’m trying to change the weight of a smart component. It’s made with interpolation, so I want to change the thickness first through interpolation refresh and then adjust it further. When I select components in the edit view and press interpolation refresh, only the Master of this component is modified.
Is there a way to interpolate all layers (Height, Width, etc.) of the selected component at once? Or, if you tell me the relevant Glyphs API, I’ll try to create a script.
Currently, interpolation refresh is only possible after selecting one component and then selecting the corresponding master and layers.
I don’t know what is the name, but at least Korean version, it is Refresh interpolation.
When I press this button(blue), this Xbold master will be newly interpolated by another master.
I think this is about clicking “Re-interpolate” from the Layer palette.
Re-interpolating a glyph for all layers is only doable with a script, but it should be very simple. Some options: Either you want to re-interpolate the whole layer, in which case you can do:
for layer in Layer.parent.layers:
layer.reinterpolate()
But I doubt that is what you want, as this will really re-interpolate all layers, starting from the first one.
Or you want to re-interpolate only some layers, in which case you need to define the layers you have selected and then run layer.reinterpolate().
Or, as an addition to the above options, you only want to re-interpolate the selected component. Then, find the component through layer.selection or by its index, re-interpolate a duplicate of the desired layer(s) and copy the resulting component into your active layer.
proxy_glyph = Layer.parent.copy()
proxy_glyph.parent = Font
component_index = list(Layer.components.index).index(Layer.selection[0])
for layer in proxy_glyph.layers:
target_layer = Layer.parent.layers[layer.associatedMasterId]
layer.reinterpolate()
target_layer.components[component_index].smartComponentValues = layer.components[component_index].smartComponentValues
del Font.glyphs[proxy_glyph.name]
That should copy the values from the re-interpolated layers to your smart component.
Be aware I didn’t test this script, I wrote it from my phone.