This might be me not understanding properly how things are supposed to work in glyphs with smart components but I’m looking for a way to use a regular master as a source of variation in a smart component.
I tried using the following script to make it work but it seems that the only way to use smart component is to use extra layers.
As it is configured now, the slider is visible but when I use it the component doesn’t change at all.
The reason for me to want to do that is that I would like to build small caps (and more) using component interpolated from my existing axis without have to decompose them.
from GlyphsApp import * f = Glyphs.font for g in f.glyphs: if g.selected: #Add a Smart ComponentAxis to the glyph axis1 = GSSmartComponentAxis() axis1.name = 'weight' axis1.topValue = 1000 axis1.bottomValue = 0 print g.smartComponentAxes g.smartComponentAxes.append(axis1) weight = g.smartComponentAxes['weight'] #Mapping existing master layers to the extremes of the smart component for layer in g.layers: if layer.name == 'Light Mid': layer.smartComponentPoleMapping[weight.id] = 1 elif layer.name == 'Bold Mid': layer.smartComponentPoleMapping[weight.id] = 2