diff --git a/Tests/designspaceLib/data/test_avar2.designspace b/Tests/designspaceLib/data/test_avar2.designspace new file mode 100644 index 000000000..db99a4697 --- /dev/null +++ b/Tests/designspaceLib/data/test_avar2.designspace @@ -0,0 +1,1481 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 2 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic Thin + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 3 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic ExtLt + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 4 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic Light + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 5 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 6 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic Med + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 7 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic SemBd + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 8 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 9 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic ExtBd + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 10 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic Blk + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 2 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic Cond Thin + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 3 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic Cond ExtLt + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 4 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic Cond Light + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 5 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic Cond + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 6 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic Cond Med + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 7 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic Cond SemBd + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 8 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic Cond + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 9 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic Cond ExtBd + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 10 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic Cond Blk + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 2 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic SemCond Thin + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 3 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic SemCond ExtLt + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 4 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic SemCond Light + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 5 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic SemCond + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 6 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic SemCond Med + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 7 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic SemCond SemBd + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 8 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic SemCond + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 9 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic SemCond ExtBd + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 10 + 2 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic SemCond Blk + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 2 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic ExtCond Thin + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 3 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic ExtCond ExtLt + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 4 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic ExtCond Light + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 5 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic ExtCond + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 6 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic ExtCond Med + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 7 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic ExtCond SemBd + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 8 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic ExtCond + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 9 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic ExtCond ExtBd + + + + + + + + + + + + + com.schriftgestaltung.customParameters + + + panose + + 2 + 11 + 10 + 6 + 4 + 5 + 4 + 2 + 2 + 4 + + + + xHeight + 536 + + + styleMapFamilyName + Noto Sans Arabic ExtCond Blk + + + + + + + + + GSDimensionPlugin.Dimensions + + 6D0603BE-7277-4DA4-8C59-7934AF28E45B + + arAlef + 82 + arBar + 82 + + 8594390A-478C-48BC-BAB2-0B8797A53DFB + + arAlef + 178 + arBar + 178 + + + public.skipExportGlyphs + + TahSmallTwoDots + TahSmallTwoDots.restricted + _bar + _barshort + _dots.horz.below + _doublebar + _doublebarshort + _hehgoalcomma + _invertedstroke + _part.Gaf.stroke + _part.beh.fina + _part.instroke + _stroke + _stroke.wide + _vbelow-ar + _vinvertedbelow-ar + _vinvertedbelow-ar.001 + _wavyhamzaabove-ar + alef-ar.fina.short + alef-ar.fina.wide + alef-ar.short + alefMaksura-ar.init.short + alefMaksura-ar.medi.tall + allah-ar.pt1 + allah-ar.pt2 + beeh-ar.init.short + beh-ar.init.short + dotcenter-ar + dotcenter-ar.small + dotlessbeh-ar.init.short + dotlessbeh-ar.init.short.wide + dotlessbeh-ar.init.wide + dotlessbeh-ar.medi.tall + dotlessbeh-ar.medi.tall.wide + dotlessbeh-ar.medi.wide + fdfd.alrahem + fdfd.alrhman + fdfd.bsm + four-persian.small01 + fourdotsabove-ar.small + fourthroot-ar.pt + hah-ar.fina.wide + hah-ar.wide + jal + jallajalalouhou1-ar.001 + jlalh + noon-ar.init.short + ringArabic + tehabove-ar.small + three-persian.small01 + threedotsdownabove-ar.small + threedotsupabove-ar.small + threedotsupabove-ar.v2 + threedotsupbelow-ar.small + two-persian.small01 + twodotshorizontalabove-ar.small + twodotshorizontalabove-ar.v2 + twodotsverticalabove-ar.small + uniFBC0.small + wasla-ar + wawDotcenter-ar.pt + wawDotcenter-ar.pt.fina + yehRohingya-ar.fina + yehRohingya-ar.pt.fina + + + + diff --git a/Tests/designspaceLib/designspace_test.py b/Tests/designspaceLib/designspace_test.py index 651172f9e..f741dbd94 100644 --- a/Tests/designspaceLib/designspace_test.py +++ b/Tests/designspaceLib/designspace_test.py @@ -689,6 +689,30 @@ def test_axisMapping(): assert r == [("ddd", [(0, 0.0), (300, 0.5), (600, 0.5), (1000, 1.0)])] +def test_axisMappingsRoundtrip(tmpdir): + # tests of axisMappings in a document, roundtripping. + import pathlib + + tmpdir = str(tmpdir) + testDocPath = (pathlib.Path(__file__) / "../data/test_avar2.designspace").resolve() + testDocPath2 = os.path.join(tmpdir, "test_avar2_roundtrip.designspace") + doc = DesignSpaceDocument() + doc.read(testDocPath) + assert doc.axisMappings + assert len(doc.axisMappings) == 3 + assert doc.axisMappings[0].inputLocation == {"Justify": 0.0} + doc.write(testDocPath2) + # verify these results + doc2 = DesignSpaceDocument() + doc2.read(testDocPath2) + assert [mapping.inputLocation for mapping in doc.axisMappings] == [ + mapping.inputLocation for mapping in doc2.axisMappings + ] + assert [mapping.outputLocation for mapping in doc.axisMappings] == [ + mapping.outputLocation for mapping in doc2.axisMappings + ] + + def test_rulesConditions(tmpdir): # tests of rules, conditionsets and conditions r1 = RuleDescriptor()