fonttools/Tests/designspaceLib/data/test.designspace

108 lines
4.6 KiB
Plaintext
Raw Normal View History

<?xml version='1.0' encoding='utf-8'?>
WIP: implement conditionSets in designspaceLib.RuleDescriptor (#1255) * [designspaceLib] WIP: add conditionSets to RuleDescriptor... the BaseDocReader still needs to be updated to be able to read both legacy condition-without-conditionset and new-style conditionset elements. * test_rules: replace rule.conditions with conditionSets * Tests: update test.designspace to use conditionset; replace 'with' with 'byname' in sub element I don't like too much that now 'byname' precedes alphabetically 'name'. We need to see if ElementTree allows to sort attribute arbitrarily * Change versionnumber to 4.0 - would that be enough, or should there be seperate major / minor fields? If we bump the version up to numeral 4, I'd like the check for the with / byname attributes. We can read the old `byname` and only write the new `with`. Remove support for `initial` in axis attributes. * WIP - formatversion, with attribute, * WIP anything that is not version 4.0 is version 3.0 added some local paths to the test so I can see what it's generating. I can take this out later. * WIP read the conditionsets properly. This makes the tests fail no longer. * WIP disambiguate axis tags from axis names. Test axes are now called "axisName_x", tags are called "TAGX" * WIP forgot to push * WIP Raise `DesignSpaceDocumentError` when no maximum or minimum are given in a condition. Add test for such an incomplete rule. Remove path cruft. * WIP improved test of raised error. * WIP because no bot. * WIP more spaces around percents. * WIP - don't skip empty subs, just load whatever is there. * WIP do not permit empty axes in a location when evaluating a rule. Fix some tests. * WIP missed a str(tempdir), some rule tests. * WIP proposal for changes to the designspace spec to the `rule` and `sub` elements. * WIP edits. * WIP. Typo.
2018-05-14 10:29:48 +01:00
<designspace format="4.0">
<axes>
<axis default="0" maximum="1000" minimum="0" name="weight" tag="wght">
<labelname xml:lang="en">Wéíght</labelname>
<labelname xml:lang="fa-IR">قطر</labelname>
</axis>
<axis default="20" hidden="1" maximum="1000" minimum="0" name="width" tag="wdth">
<labelname xml:lang="fr">Chasse</labelname>
<map input="0" output="10" />
<map input="401" output="66" />
<map input="1000" output="990" />
</axis>
</axes>
<rules>
<rule name="named.rule.1">
WIP: implement conditionSets in designspaceLib.RuleDescriptor (#1255) * [designspaceLib] WIP: add conditionSets to RuleDescriptor... the BaseDocReader still needs to be updated to be able to read both legacy condition-without-conditionset and new-style conditionset elements. * test_rules: replace rule.conditions with conditionSets * Tests: update test.designspace to use conditionset; replace 'with' with 'byname' in sub element I don't like too much that now 'byname' precedes alphabetically 'name'. We need to see if ElementTree allows to sort attribute arbitrarily * Change versionnumber to 4.0 - would that be enough, or should there be seperate major / minor fields? If we bump the version up to numeral 4, I'd like the check for the with / byname attributes. We can read the old `byname` and only write the new `with`. Remove support for `initial` in axis attributes. * WIP - formatversion, with attribute, * WIP anything that is not version 4.0 is version 3.0 added some local paths to the test so I can see what it's generating. I can take this out later. * WIP read the conditionsets properly. This makes the tests fail no longer. * WIP disambiguate axis tags from axis names. Test axes are now called "axisName_x", tags are called "TAGX" * WIP forgot to push * WIP Raise `DesignSpaceDocumentError` when no maximum or minimum are given in a condition. Add test for such an incomplete rule. Remove path cruft. * WIP improved test of raised error. * WIP because no bot. * WIP more spaces around percents. * WIP - don't skip empty subs, just load whatever is there. * WIP do not permit empty axes in a location when evaluating a rule. Fix some tests. * WIP missed a str(tempdir), some rule tests. * WIP proposal for changes to the designspace spec to the `rule` and `sub` elements. * WIP edits. * WIP. Typo.
2018-05-14 10:29:48 +01:00
<conditionset>
<condition maximum="1" minimum="0" name="axisName_a" />
<condition maximum="3" minimum="2" name="axisName_b" />
</conditionset>
<sub name="a" with="a.alt" />
</rule>
</rules>
<sources>
<source familyname="MasterFamilyName" filename="masters/masterTest1.ufo" name="master.ufo1" stylename="MasterStyleNameOne">
<lib copy="1" />
<features copy="1" />
<info copy="1" />
<glyph mute="1" name="A" />
<glyph mute="1" name="Z" />
<location>
<dimension name="weight" xvalue="0" />
<dimension name="width" xvalue="20" />
</location>
</source>
<source familyname="MasterFamilyName" filename="masters/masterTest2.ufo" name="master.ufo2" stylename="MasterStyleNameTwo">
<kerning mute="1" />
<location>
<dimension name="weight" xvalue="1000" />
<dimension name="width" xvalue="20" />
</location>
</source>
<source familyname="MasterFamilyName" filename="masters/masterTest2.ufo" layer="supports" name="master.ufo2" stylename="Supports">
<location>
<dimension name="weight" xvalue="1000" />
<dimension name="width" xvalue="20" />
</location>
</source>
</sources>
<instances>
<instance familyname="InstanceFamilyName" filename="instances/instanceTest1.ufo" name="instance.ufo1" postscriptfontname="InstancePostscriptName" stylemapfamilyname="InstanceStyleMapFamilyName" stylemapstylename="InstanceStyleMapStyleName" stylename="InstanceStyleName">
<location>
<dimension name="weight" xvalue="500" />
<dimension name="width" xvalue="20" />
</location>
<glyphs>
<glyph mute="1" name="arrow" unicode="0x123 0x124 0x125" />
</glyphs>
<kerning />
<info />
<lib>
<dict>
<key>com.coolDesignspaceApp.specimenText</key>
<string>Hamburgerwhatever</string>
</dict>
</lib>
</instance>
<instance familyname="InstanceFamilyName" filename="instances/instanceTest2.ufo" name="instance.ufo2" postscriptfontname="InstancePostscriptName" stylemapfamilyname="InstanceStyleMapFamilyName" stylemapstylename="InstanceStyleMapStyleName" stylename="InstanceStyleName">
<location>
<dimension name="weight" xvalue="500" />
<dimension name="width" xvalue="400" yvalue="300" />
</location>
<glyphs>
<glyph name="arrow" unicode="0x65 0xc9 0x12d">
<location>
<dimension name="weight" xvalue="120" />
<dimension name="width" xvalue="100" />
</location>
<note>A note about this glyph</note>
<masters>
<master glyphname="BB" source="master.ufo1">
<location>
<dimension name="weight" xvalue="20" />
<dimension name="width" xvalue="20" />
</location>
</master>
<master glyphname="CC" source="master.ufo2">
<location>
<dimension name="weight" xvalue="900" />
<dimension name="width" xvalue="900" />
</location>
</master>
</masters>
</glyph>
<glyph name="arrow2" />
</glyphs>
<kerning />
<info />
</instance>
</instances>
<lib>
<dict>
<key>com.coolDesignspaceApp.previewSize</key>
<integer>30</integer>
</dict>
</lib>
</designspace>