def testDocument(docPath): # make the test fonts and a test document testFontPath = os.path.join(os.getcwd(), "automatic_testfonts") m1, m2, i1, i2, i3 = makeTestFonts(testFontPath) d = DesignSpaceProcessor() a = AxisDescriptor() a.name = "pop" a.minimum = 50 a.maximum = 1000 a.default = 0 a.tag = "pop*" d.addAxis(a) s1 = SourceDescriptor() s1.path = m1 s1.location = dict(pop=a.minimum) s1.name = "test.master.1" s1.copyInfo = True s1.copyFeatures = True s1.copyLib = True d.addSource(s1) s2 = SourceDescriptor() s2.path = m2 s2.location = dict(pop=1000) s2.name = "test.master.2" #s2.copyInfo = True d.addSource(s2) for counter in range(3): factor = counter / 2 i = InstanceDescriptor() v = a.minimum + factor * (a.maximum - a.minimum) i.path = i1 % v i.familyName = "TestFamily" i.styleName = "TestStyle_pop%3.3f" % (v) i.name = "%s-%s" % (i.familyName, i.styleName) i.location = dict(pop=v) i.info = True i.kerning = True if counter == 2: i.glyphs['glyphTwo'] = dict(name="glyphTwo", mute=True) i.copyLib = True if counter == 2: i.glyphs['narrow'] = dict(instanceLocation=dict(pop=400), unicodes=[0x123, 0x124, 0x125]) d.addInstance(i) d.write(docPath)
doc.addAxis(a2) #--------- # masters #--------- s0 = SourceDescriptor() s0.path = "MutatorSansLightCondensed.ufo" s0.name = "master.MutatorMathTest.LightCondensed.0" s0.familyName = familyName s0.styleName = "LightCondensed" s0.location = dict(weight=0, width=0) s0.copyLib = True s0.copyInfo = True s0.copyGroups = True s0.copyFeatures = True doc.addSource(s0) s1 = SourceDescriptor() s1.path = "MutatorSansBoldCondensed.ufo" s1.name = "master.MutatorMathTest.BoldCondensed.1" s1.familyName = familyName s1.styleName = "BoldCondensed" s1.location = dict(weight=1000, width=0) doc.addSource(s1) s2 = SourceDescriptor() s2.path = "MutatorSansLightWide.ufo" s2.name = "master.MutatorMathTest.LightWide.2" s2.familyName = familyName s2.styleName = "LightWide"