Knowing Exports Sidebearings

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?

Thanks in advance.

You can get this through scripting.

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.

What do you need?

You can run my script above in the Macro Panel (Window > Macro Panel) and it will show you the LSB/RSB for the glyph “A” in all instances.

If you describe exactly what you need, I can easily adapt the script to work for your case.

Well, let me run that script in the Macro Panel and if it works, I’ve achieved it.
I’ll let you know if I succeeded.

Hey, It works!

Just to know, this only works glyphs by glyphs, right? Or there’s a way to take all LSB/RSB from all characters in all instances once and for all?

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)))

Dear Sebastian, you’ve earned your place in heaven! Many thanks.