fonttools/Tests/designspaceLib/data/test.designspace

112 lines
4.0 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 tag="wght" name="weight" minimum="0" maximum="1000" default="0">
<labelname xml:lang="en">Wéíght</labelname>
<labelname xml:lang="fa-IR">قطر</labelname>
</axis>
<axis tag="wdth" name="width" minimum="0" maximum="1000" default="20" hidden="1">
<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">
<conditionset>
<condition name="axisName_a" minimum="0" maximum="1"/>
<condition name="axisName_b" minimum="2" maximum="3"/>
</conditionset>
<sub name="a" with="a.alt"/>
</rule>
</rules>
<sources>
<source filename="masters/masterTest1.ufo" name="master.ufo1" familyname="MasterFamilyName" stylename="MasterStyleNameOne">
<lib copy="1"/>
<features copy="1"/>
<info copy="1"/>
<glyph name="A" mute="1"/>
<glyph name="Z" mute="1"/>
<location>
<dimension name="weight" xvalue="0"/>
<dimension name="width" xvalue="20"/>
</location>
</source>
<source filename="masters/masterTest2.ufo" name="master.ufo2" familyname="MasterFamilyName" stylename="MasterStyleNameTwo">
<kerning mute="1"/>
<location>
<dimension name="weight" xvalue="1000"/>
<dimension name="width" xvalue="20"/>
</location>
</source>
<source filename="masters/masterTest2.ufo" name="master.ufo2" familyname="MasterFamilyName" stylename="Supports" layer="supports">
<location>
<dimension name="weight" xvalue="1000"/>
<dimension name="width" xvalue="20"/>
</location>
</source>
</sources>
<instances>
<instance name="instance.ufo1" familyname="InstanceFamilyName" stylename="InstanceStyleName" filename="instances/instanceTest1.ufo" postscriptfontname="InstancePostscriptName" stylemapfamilyname="InstanceStyleMapFamilyName" stylemapstylename="InstanceStyleMapStyleName">
<location>
<dimension name="weight" xvalue="500"/>
<dimension name="width" xvalue="20"/>
</location>
<glyphs>
<glyph mute="1" unicode="0x123 0x124 0x125" name="arrow"/>
</glyphs>
<kerning/>
<info/>
<lib>
<dict>
<key>com.coolDesignspaceApp.binaryData</key>
<data>
PGJpbmFyeSBndW5rPg==
</data>
<key>com.coolDesignspaceApp.specimenText</key>
<string>Hamburgerwhatever</string>
</dict>
</lib>
</instance>
<instance name="instance.ufo2" familyname="InstanceFamilyName" stylename="InstanceStyleName" filename="instances/instanceTest2.ufo" postscriptfontname="InstancePostscriptName" stylemapfamilyname="InstanceStyleMapFamilyName" stylemapstylename="InstanceStyleMapStyleName">
<location>
<dimension name="weight" xvalue="500"/>
<dimension name="width" xvalue="400" yvalue="300"/>
</location>
<glyphs>
<glyph unicode="0x65 0xc9 0x12d" name="arrow">
<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>