Deleting “Localized Family Names” via script

Is it possible to delete the “Localized Family Names” property of an instance (a.k.a. export) via script?

Another question related to instances: How can I duplicate an instance?

If I do something like

font.instances.append(font.instances[0])
font.instances[-1].name = ‘New name’

This will also rename the first instance, which I do not want.

For that you need to create a copy of your instance with copy()

font.instances.append(font.instances[0].copy())
font.instances[-1].name = ‘New name’

What Hugo said.

For removing a “Localized Family Names” property, try this:

i = Font.instances[0]  # for example
parameter = i.propertyForName_("familyNames")
i.removeObjectFromProperties_(parameter)

It should be:

instance.setProperty_value_languageTag_(GSPropertyNameFamilyNamesKey, None, "DEU")

But that was broken in the instances.

for now, if you like to remove an value for a specific language:

prop = instance.propertyForName_("familyNames")
infoValue = prop.infoValueForLanguageTag_("DEU")
if infoValue:
	prop.removeObjectFromValues_(infoValue)

Thanks, everyone!