from fontParts.world import NewFont
font = NewFont(familyName="MyFont", styleName="Regular")
layer = font.newLayer("foreground")
font.defaultLayer = layer
font.save("test.ufo") # this raises an issue
the patch:
if defaultLayerName is not None:
# change the name of the newly created default layer
font.defaultLayer.name = defaultLayerName
When creating a new font object it would be nice to set the name of the default layer.
When the default layer name is not "public.default", the layer name "public.default" cannot exists, defcon asserts
proposal, similar to the optional arguments
familyName
,styleName
A tiny script to show the problem:
the patch: