I’ve tried the code below in a few files created in Glyphs 2 and I always get a 'float' object is not callable error. It doesn’t matter if I convert the files to Glyphs 3 format, the error remains.
Glyphs.clearLog()
font = Glyphs.font
try:
print("font.masters:")
print(font.masters)
except Exception as e:
print(e)
print()
try:
print("font.instances:")
print(font.instances)
except Exception as e:
print(e)
print()
try:
print("loop through font.instances:")
for instance in font.instances:
print(instance)
except Exception as e:
print(e)
This is the result:
font.masters:
'float' object is not callable
font.instances:
(
"<GSInstance 0x600003282c40> Regular (74.0)",
"<GSInstance 0x600003281b00> SemiBold (98.0)",
"<GSInstance 0x6000032800c0> Bold (118.0)"
)
loop through font.instances:
'float' object is not callable
One last thing: in build 3042, the fontName and fullName properties return only the first character of the string.
In a related subject, I was trying to export a file that had errors in the smcp feature (forgot to update the feature after renaming some glyphs) using the generate() function. It obviously exported nothing, but it didn’t throw me an error. In fact, the function returned True.