Hi,
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
Is there a reason why it is only possible to map Smart components to top and bottom (in my case 0 and 1000)?
I have intermediate masters (& brackets) steps that I would like to be used too.
I tried using interpolationProxy to make the same thing using outlines (and it works), but I think the smartComponent UI is much more pratical to fine tune the right interpolation values. It would be great if it could work!
What do you mean? As it is now (Glyphs 3.0.2, build 3053) I only get the opportunity to map top and bottom, so my intermediate masters (or bracket layers) can’t be set.
For example in a designspace of:
Weight [0,1000]
Width [0,1000]
I can not integrate [500,1000] or [500,500]
I can only map [0,1000], [1000,1000], [0,0] and [1000,0].
This is what the interface looks like. In the scripting documentation, it only introduces “top” and “bottom” (1 and 2), not the axis value.
Is there a way to do that?
Oh ok, then there is something not working.
I already sent my file to Rainer (on the support mail) for another issue (weird interpolation behaviour on variable font export).
I didn’t get a reply yet, I don’t know if he had time to have a look.
I since tried to erase as much things from the file to try to find the source of the problem but even without any component, kerning, opentype, hinting and non master layers (only kept brace layers) it keeps going.
Let me know if you need me to send the file again.
It didn’t solve the problem, the intermediate masters are not being used by the smartComponent interpolation.
It would be nice to have a way to set the smartComonent axes values manually (with UI or scripting API).
You master setup is quite a handful. And the intermediate layer is picked up. The problem is that all the other default middle master are not. You are using the smart components in a un-intended way. I have an idea on how it might be possible to do something like what you are trying but I’m not sure.