doc = buildDesignSpace(sources, instances, axes) #add rule for dollar. Needs to be after doc = buildDesignSpace() because this doc is a DesignSpaceDocument(), rather than the doc above which is a DesignSpaceDocumentReader() object # r1 = RuleDescriptor() # r1.name = "heavy-bars-wght" # r1.conditions.append(dict(name="wght", minimum=800, maximum=850)) # r1.subs.append(("dollar", "dollar.rvrn2")) # doc.addRule(r1) r2 = RuleDescriptor() r2.name = "heavier-bars-wght" r2.conditions.append(dict(name="wght", minimum=800, maximum=900)) r2.subs.append(("dollar", "dollar.rvrn")) doc.addRule(r2) doc.write(designSpace) default = "Amstelvar-Italic.ufo" # load the default font default_path = os.path.join(src_dir, default) dflt = Font(default_path) sources = [source.name for source in doc.sources] # take the default out of the source list sources.remove(default) print("Building masters...") # load font objects