Hi! There’s a way to know the sidebearing from the instances at certain axis cordinate? I mean, I can see and set the sidebearing from each glyph in each masters, but what if I need to know the side bearing from some glyphs of any instance at some point in axis cordinates?
The only way I mind is “generating instances”. Maybe that’s the only way?
glyph_name = "A"
for instance in Font.instances:
proxy_font = instance.interpolatedFont # Returns a GSFont object for the instance
if not proxy_font: # VF settings will return None
continue
master = proxy_font.masters[0] # Get the (only) master
glyph = proxy_font.glyphs[glyph_name]
layer = glyph.layers[master.id]
print("\n###\n%s\nGlyph %s:\nLSB: %s / RSB: %s" % (instance.name, glyph_name, int(layer.LSB), int(layer.RSB)))
Thanks so much! For sure this is the propper and fastest way to do it but the truth is, I haven’t the faintest idea how to do it that way. I think I’m going for “generating instances” and make it manually.
for instance in Font.instances:
proxy_font = instance.interpolatedFont # Returns a GSFont object for the instance
if not proxy_font: # VF settings will return None
continue
print("\n###\n%s" % instance.name)
master = proxy_font.masters[0] # Get the (only) master
for glyph in proxy_font.glyphs:
layer = glyph.layers[master.id]
print("\n%s\nLSB: %s / RSB: %s" % (glyph.name, int(layer.LSB), int(layer.RSB)))