diff --git a/Doc/source/designspaceLib/scripting.rst b/Doc/source/designspaceLib/scripting.rst index 447513c01..2bd4a0a18 100644 --- a/Doc/source/designspaceLib/scripting.rst +++ b/Doc/source/designspaceLib/scripting.rst @@ -59,6 +59,8 @@ Make a descriptor object and add it to the document. - The ``tag`` attribute is the one of the registered `OpenType Variation Axis Tags `__ +- The default master is expected at the intersection of all + default values of all axes. Option: add label names ----------------------- @@ -122,6 +124,7 @@ So go ahead and add another master: s1.name = "master.bold" s1.location = dict(weight=1000) doc.addSource(s1) + Option: exclude glyphs ---------------------- diff --git a/Tests/designspaceLib/designspace_test.py b/Tests/designspaceLib/designspace_test.py index bf49e2e96..24e2090e4 100644 --- a/Tests/designspaceLib/designspace_test.py +++ b/Tests/designspaceLib/designspace_test.py @@ -604,6 +604,25 @@ def test_normalise4(): r.sort() assert r == [('ddd', [(0, 0.1), (300, 0.5), (600, 0.5), (1000, 0.9)])] +def test_axisMapping(): + # note: because designspance lib does not do any actual + # processing of the mapping data, we can only check if there data is there. + doc = DesignSpaceDocument() + # write some axes + a4 = AxisDescriptor() + a4.minimum = 0 + a4.maximum = 1000 + a4.default = 0 + a4.name = "ddd" + a4.map = [(0,100), (300, 500), (600, 500), (1000,900)] + doc.addAxis(a4) + doc.normalize() + r = [] + for axis in doc.axes: + r.append((axis.name, axis.map)) + r.sort() + assert r == [('ddd', [(0, 0.1), (300, 0.5), (600, 0.5), (1000, 0.9)])] + def test_rulesConditions(tmpdir): # tests of rules, conditionsets and conditions r1 = RuleDescriptor()