In the latest version of the beta (3.3 build 3305) line 3 of this code now produces an error. I’ve been using this for years. It seems like the issue is with GlyphsApp.PropertiesProxy (the type of .properties), because the issue doesn’t seem to occur when I set .properties to be a Python list of the same font info value objects.
Just create a temporary instance that shares all or most of the info as an existing instance. So I want to copy all of the properties from the existing instance to the new one. I also do this when creating an instance from a master.
I use this code in Font Proofer’s Glyphs plugin. Every time you release a beta with a regression like this I need to stop what I’m doing and spend hours finding a workaround and releasing a patch update ASAP. So many Glyphs users use the public beta, and they expect it to be stable (even if that’s unrealistic). Could you send me a version to test before releasing it publicly? And going forward would you consider having a nightly/alpha program for plugin developers?
I’ve been experiencing a possibly related issue. I run a quick script just to fill in some font info fields and I have been getting the following error:
# MenuTitle: Cambridge Production
MacroTab.title = ""
def addPropertyToFont(font, key, value):
while font.propertyForName_(key):
font.removeObjectFromProperties_(font.propertyForName_(key))
prop = GSFontInfoValueSingle()
prop.key = key
prop.value = value
font.properties.append(prop)
for font in Glyphs.fonts:
# speed up processing the font by disabling UI updates:
font.disableUpdateInterface()
if not "Cambridge" in font.familyName:
continue
# skip if it is not the font we want
# PROPERTIES
# convenience, see API docs: https://docu.glyphsapp.com/#gsfont
font.copyright = "."
font.manufacturer = "."
key = "versionString"
value = "Version %d.%03d"
addPropertyToFont(font, key, value)
# FONT INFO
parameters = {
"Use Extension Kerning": True,
"Export Mac Name Table Entries": True,
"Use Typo Metrics": True,
"Get Hints From Master": font.masters[0].id,
"typoAscender": 1020,
"typoDescender": -340,
"typoLineGap": 0,
"hheaAscender": 1020,
"hheaDescender": -340,
"hheaLineGap": 0,
"winAscent": 1400,
"winDescent": 340,
}
for parameterName in parameters.keys():
value = parameters[parameterName]
font.customParameters[parameterName] = value
# GLYPH OR
# reenable UI updates:
font.enableUpdateInterface()