instancer_test: update tests for instantiateSTAT new behavior

And add tests for limiting STAT's axis ranges.
This commit is contained in:
Cosimo Lupo 2019-10-17 19:03:30 +01:00
parent 3c6ddb0ef8
commit 10d544d6a4
No known key found for this signature in database
GPG Key ID: 20D4A261E4A0E642
8 changed files with 578 additions and 50 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="3.41"> <ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="4.0">
<GlyphOrder> <GlyphOrder>
<!-- The 'id' attribute is only for humans; it is ignored when parsed. --> <!-- The 'id' attribute is only for humans; it is ignored when parsed. -->
@ -14,16 +14,16 @@
<!-- Most of this table will be recalculated by the compiler --> <!-- Most of this table will be recalculated by the compiler -->
<tableVersion value="1.0"/> <tableVersion value="1.0"/>
<fontRevision value="2.001"/> <fontRevision value="2.001"/>
<checkSumAdjustment value="0x6b1f158e"/> <checkSumAdjustment value="0x605c3e60"/>
<magicNumber value="0x5f0f3cf5"/> <magicNumber value="0x5f0f3cf5"/>
<flags value="00000000 00000011"/> <flags value="00000000 00000011"/>
<unitsPerEm value="1000"/> <unitsPerEm value="1000"/>
<created value="Tue Mar 15 19:50:39 2016"/> <created value="Tue Mar 15 19:50:39 2016"/>
<modified value="Tue May 21 16:23:19 2019"/> <modified value="Thu Oct 17 14:43:10 2019"/>
<xMin value="-621"/> <xMin value="0"/>
<yMin value="-389"/> <yMin value="0"/>
<xMax value="2800"/> <xMax value="638"/>
<yMax value="1067"/> <yMax value="944"/>
<macStyle value="00000000 00000000"/> <macStyle value="00000000 00000000"/>
<lowestRecPPEM value="6"/> <lowestRecPPEM value="6"/>
<fontDirectionHint value="2"/> <fontDirectionHint value="2"/>
@ -36,10 +36,10 @@
<ascent value="1069"/> <ascent value="1069"/>
<descent value="-293"/> <descent value="-293"/>
<lineGap value="0"/> <lineGap value="0"/>
<advanceWidthMax value="2840"/> <advanceWidthMax value="639"/>
<minLeftSideBearing value="-621"/> <minLeftSideBearing value="0"/>
<minRightSideBearing value="-620"/> <minRightSideBearing value="1"/>
<xMaxExtent value="2800"/> <xMaxExtent value="638"/>
<caretSlopeRise value="1"/> <caretSlopeRise value="1"/>
<caretSlopeRun value="0"/> <caretSlopeRun value="0"/>
<caretOffset value="0"/> <caretOffset value="0"/>
@ -55,10 +55,10 @@
<!-- Most of this table will be recalculated by the compiler --> <!-- Most of this table will be recalculated by the compiler -->
<tableVersion value="0x10000"/> <tableVersion value="0x10000"/>
<numGlyphs value="5"/> <numGlyphs value="5"/>
<maxPoints value="202"/> <maxPoints value="19"/>
<maxContours value="24"/> <maxContours value="2"/>
<maxCompositePoints value="315"/> <maxCompositePoints value="32"/>
<maxCompositeContours value="21"/> <maxCompositeContours value="3"/>
<maxZones value="1"/> <maxZones value="1"/>
<maxTwilightPoints value="0"/> <maxTwilightPoints value="0"/>
<maxStorage value="0"/> <maxStorage value="0"/>
@ -66,8 +66,8 @@
<maxInstructionDefs value="0"/> <maxInstructionDefs value="0"/>
<maxStackElements value="0"/> <maxStackElements value="0"/>
<maxSizeOfInstructions value="0"/> <maxSizeOfInstructions value="0"/>
<maxComponentElements value="8"/> <maxComponentElements value="2"/>
<maxComponentDepth value="8"/> <maxComponentDepth value="1"/>
</maxp> </maxp>
<OS_2> <OS_2>
@ -107,8 +107,8 @@
<ulUnicodeRange4 value="00000000 00010000 00000000 00000000"/> <ulUnicodeRange4 value="00000000 00010000 00000000 00000000"/>
<achVendID value="GOOG"/> <achVendID value="GOOG"/>
<fsSelection value="00000001 01000000"/> <fsSelection value="00000001 01000000"/>
<usFirstCharIndex value="0"/> <usFirstCharIndex value="65"/>
<usLastCharIndex value="65533"/> <usLastCharIndex value="192"/>
<sTypoAscender value="1069"/> <sTypoAscender value="1069"/>
<sTypoDescender value="-293"/> <sTypoDescender value="-293"/>
<sTypoLineGap value="0"/> <sTypoLineGap value="0"/>
@ -1037,15 +1037,104 @@
<Axis index="0"> <Axis index="0">
<AxisTag value="wght"/> <AxisTag value="wght"/>
<AxisNameID value="256"/> <!-- Weight --> <AxisNameID value="256"/> <!-- Weight -->
<AxisOrdering value="0"/> <AxisOrdering value="1"/>
</Axis> </Axis>
<Axis index="1"> <Axis index="1">
<AxisTag value="wdth"/> <AxisTag value="wdth"/>
<AxisNameID value="257"/> <!-- Width --> <AxisNameID value="257"/> <!-- Width -->
<AxisOrdering value="1"/> <AxisOrdering value="0"/>
</Axis> </Axis>
</DesignAxisRecord> </DesignAxisRecord>
<!-- AxisValueCount=0 --> <!-- AxisValueCount=13 -->
<AxisValueArray>
<AxisValue index="0" Format="1">
<AxisIndex value="0"/>
<Flags value="0"/>
<ValueNameID value="258"/> <!-- Thin -->
<Value value="100.0"/>
</AxisValue>
<AxisValue index="1" Format="1">
<AxisIndex value="0"/>
<Flags value="0"/>
<ValueNameID value="259"/> <!-- ExtraLight -->
<Value value="200.0"/>
</AxisValue>
<AxisValue index="2" Format="1">
<AxisIndex value="0"/>
<Flags value="0"/>
<ValueNameID value="260"/> <!-- Light -->
<Value value="300.0"/>
</AxisValue>
<AxisValue index="3" Format="3">
<AxisIndex value="0"/>
<Flags value="2"/>
<ValueNameID value="261"/> <!-- Regular -->
<Value value="400.0"/>
<LinkedValue value="700.0"/>
</AxisValue>
<AxisValue index="4" Format="1">
<AxisIndex value="0"/>
<Flags value="0"/>
<ValueNameID value="262"/> <!-- Medium -->
<Value value="500.0"/>
</AxisValue>
<AxisValue index="5" Format="1">
<AxisIndex value="0"/>
<Flags value="0"/>
<ValueNameID value="263"/> <!-- SemiBold -->
<Value value="600.0"/>
</AxisValue>
<AxisValue index="6" Format="1">
<AxisIndex value="0"/>
<Flags value="0"/>
<ValueNameID value="264"/> <!-- Bold -->
<Value value="700.0"/>
</AxisValue>
<AxisValue index="7" Format="1">
<AxisIndex value="0"/>
<Flags value="0"/>
<ValueNameID value="265"/> <!-- ExtraBold -->
<Value value="800.0"/>
</AxisValue>
<AxisValue index="8" Format="1">
<AxisIndex value="0"/>
<Flags value="0"/>
<ValueNameID value="266"/> <!-- Black -->
<Value value="900.0"/>
</AxisValue>
<AxisValue index="9" Format="2">
<AxisIndex value="1"/>
<Flags value="2"/>
<ValueNameID value="261"/> <!-- Regular -->
<NominalValue value="100.0"/>
<RangeMinValue value="93.75"/>
<RangeMaxValue value="100.0"/>
</AxisValue>
<AxisValue index="10" Format="2">
<AxisIndex value="1"/>
<Flags value="0"/>
<ValueNameID value="270"/> <!-- SemiCondensed -->
<NominalValue value="87.5"/>
<RangeMinValue value="81.25"/>
<RangeMaxValue value="93.75"/>
</AxisValue>
<AxisValue index="11" Format="2">
<AxisIndex value="1"/>
<Flags value="0"/>
<ValueNameID value="279"/> <!-- Condensed -->
<NominalValue value="75.0"/>
<RangeMinValue value="68.75"/>
<RangeMaxValue value="81.25"/>
</AxisValue>
<AxisValue index="12" Format="2">
<AxisIndex value="1"/>
<Flags value="0"/>
<ValueNameID value="288"/> <!-- ExtraCondensed -->
<NominalValue value="62.5"/>
<RangeMinValue value="62.5"/>
<RangeMaxValue value="68.75"/>
</AxisValue>
</AxisValueArray>
<ElidedFallbackNameID value="2"/> <!-- Regular --> <ElidedFallbackNameID value="2"/> <!-- Regular -->
</STAT> </STAT>

View File

@ -14,12 +14,12 @@
<!-- Most of this table will be recalculated by the compiler --> <!-- Most of this table will be recalculated by the compiler -->
<tableVersion value="1.0"/> <tableVersion value="1.0"/>
<fontRevision value="2.001"/> <fontRevision value="2.001"/>
<checkSumAdjustment value="0x982d27a8"/> <checkSumAdjustment value="0x90f1c28"/>
<magicNumber value="0x5f0f3cf5"/> <magicNumber value="0x5f0f3cf5"/>
<flags value="00000000 00000011"/> <flags value="00000000 00000011"/>
<unitsPerEm value="1000"/> <unitsPerEm value="1000"/>
<created value="Tue Mar 15 19:50:39 2016"/> <created value="Tue Mar 15 19:50:39 2016"/>
<modified value="Tue May 21 16:23:19 2019"/> <modified value="Thu Oct 17 14:43:10 2019"/>
<xMin value="0"/> <xMin value="0"/>
<yMin value="0"/> <yMin value="0"/>
<xMax value="577"/> <xMax value="577"/>
@ -238,6 +238,18 @@
</glyf> </glyf>
<name> <name>
<namerecord nameID="256" platformID="1" platEncID="0" langID="0x0" unicode="True">
Weight
</namerecord>
<namerecord nameID="257" platformID="1" platEncID="0" langID="0x0" unicode="True">
Width
</namerecord>
<namerecord nameID="258" platformID="1" platEncID="0" langID="0x0" unicode="True">
Thin
</namerecord>
<namerecord nameID="261" platformID="1" platEncID="0" langID="0x0" unicode="True">
Regular
</namerecord>
<namerecord nameID="0" platformID="3" platEncID="1" langID="0x409"> <namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
Copyright 2015 Google Inc. All Rights Reserved. Copyright 2015 Google Inc. All Rights Reserved.
</namerecord> </namerecord>
@ -283,6 +295,18 @@
<namerecord nameID="14" platformID="3" platEncID="1" langID="0x409"> <namerecord nameID="14" platformID="3" platEncID="1" langID="0x409">
http://scripts.sil.org/OFL http://scripts.sil.org/OFL
</namerecord> </namerecord>
<namerecord nameID="256" platformID="3" platEncID="1" langID="0x409">
Weight
</namerecord>
<namerecord nameID="257" platformID="3" platEncID="1" langID="0x409">
Width
</namerecord>
<namerecord nameID="258" platformID="3" platEncID="1" langID="0x409">
Thin
</namerecord>
<namerecord nameID="261" platformID="3" platEncID="1" langID="0x409">
Regular
</namerecord>
</name> </name>
<post> <post>
@ -481,4 +505,40 @@
</LookupList> </LookupList>
</GSUB> </GSUB>
<STAT>
<Version value="0x00010001"/>
<DesignAxisRecordSize value="8"/>
<!-- DesignAxisCount=2 -->
<DesignAxisRecord>
<Axis index="0">
<AxisTag value="wght"/>
<AxisNameID value="256"/> <!-- Weight -->
<AxisOrdering value="1"/>
</Axis>
<Axis index="1">
<AxisTag value="wdth"/>
<AxisNameID value="257"/> <!-- Width -->
<AxisOrdering value="0"/>
</Axis>
</DesignAxisRecord>
<!-- AxisValueCount=2 -->
<AxisValueArray>
<AxisValue index="0" Format="1">
<AxisIndex value="0"/>
<Flags value="0"/>
<ValueNameID value="258"/> <!-- Thin -->
<Value value="100.0"/>
</AxisValue>
<AxisValue index="1" Format="2">
<AxisIndex value="1"/>
<Flags value="2"/>
<ValueNameID value="261"/> <!-- Regular -->
<NominalValue value="100.0"/>
<RangeMinValue value="93.75"/>
<RangeMaxValue value="100.0"/>
</AxisValue>
</AxisValueArray>
<ElidedFallbackNameID value="2"/> <!-- Regular -->
</STAT>
</ttFont> </ttFont>

View File

@ -14,12 +14,12 @@
<!-- Most of this table will be recalculated by the compiler --> <!-- Most of this table will be recalculated by the compiler -->
<tableVersion value="1.0"/> <tableVersion value="1.0"/>
<fontRevision value="2.001"/> <fontRevision value="2.001"/>
<checkSumAdjustment value="0x1d4f3a2e"/> <checkSumAdjustment value="0x31525751"/>
<magicNumber value="0x5f0f3cf5"/> <magicNumber value="0x5f0f3cf5"/>
<flags value="00000000 00000011"/> <flags value="00000000 00000011"/>
<unitsPerEm value="1000"/> <unitsPerEm value="1000"/>
<created value="Tue Mar 15 19:50:39 2016"/> <created value="Tue Mar 15 19:50:39 2016"/>
<modified value="Tue May 21 16:23:19 2019"/> <modified value="Thu Oct 17 14:43:10 2019"/>
<xMin value="0"/> <xMin value="0"/>
<yMin value="0"/> <yMin value="0"/>
<xMax value="496"/> <xMax value="496"/>
@ -238,6 +238,18 @@
</glyf> </glyf>
<name> <name>
<namerecord nameID="256" platformID="1" platEncID="0" langID="0x0" unicode="True">
Weight
</namerecord>
<namerecord nameID="257" platformID="1" platEncID="0" langID="0x0" unicode="True">
Width
</namerecord>
<namerecord nameID="258" platformID="1" platEncID="0" langID="0x0" unicode="True">
Thin
</namerecord>
<namerecord nameID="288" platformID="1" platEncID="0" langID="0x0" unicode="True">
ExtraCondensed
</namerecord>
<namerecord nameID="0" platformID="3" platEncID="1" langID="0x409"> <namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
Copyright 2015 Google Inc. All Rights Reserved. Copyright 2015 Google Inc. All Rights Reserved.
</namerecord> </namerecord>
@ -283,6 +295,18 @@
<namerecord nameID="14" platformID="3" platEncID="1" langID="0x409"> <namerecord nameID="14" platformID="3" platEncID="1" langID="0x409">
http://scripts.sil.org/OFL http://scripts.sil.org/OFL
</namerecord> </namerecord>
<namerecord nameID="256" platformID="3" platEncID="1" langID="0x409">
Weight
</namerecord>
<namerecord nameID="257" platformID="3" platEncID="1" langID="0x409">
Width
</namerecord>
<namerecord nameID="258" platformID="3" platEncID="1" langID="0x409">
Thin
</namerecord>
<namerecord nameID="288" platformID="3" platEncID="1" langID="0x409">
ExtraCondensed
</namerecord>
</name> </name>
<post> <post>
@ -481,4 +505,40 @@
</LookupList> </LookupList>
</GSUB> </GSUB>
<STAT>
<Version value="0x00010001"/>
<DesignAxisRecordSize value="8"/>
<!-- DesignAxisCount=2 -->
<DesignAxisRecord>
<Axis index="0">
<AxisTag value="wght"/>
<AxisNameID value="256"/> <!-- Weight -->
<AxisOrdering value="1"/>
</Axis>
<Axis index="1">
<AxisTag value="wdth"/>
<AxisNameID value="257"/> <!-- Width -->
<AxisOrdering value="0"/>
</Axis>
</DesignAxisRecord>
<!-- AxisValueCount=2 -->
<AxisValueArray>
<AxisValue index="0" Format="1">
<AxisIndex value="0"/>
<Flags value="0"/>
<ValueNameID value="258"/> <!-- Thin -->
<Value value="100.0"/>
</AxisValue>
<AxisValue index="1" Format="2">
<AxisIndex value="1"/>
<Flags value="0"/>
<ValueNameID value="288"/> <!-- ExtraCondensed -->
<NominalValue value="62.5"/>
<RangeMinValue value="62.5"/>
<RangeMaxValue value="68.75"/>
</AxisValue>
</AxisValueArray>
<ElidedFallbackNameID value="2"/> <!-- Regular -->
</STAT>
</ttFont> </ttFont>

View File

@ -14,12 +14,12 @@
<!-- Most of this table will be recalculated by the compiler --> <!-- Most of this table will be recalculated by the compiler -->
<tableVersion value="1.0"/> <tableVersion value="1.0"/>
<fontRevision value="2.001"/> <fontRevision value="2.001"/>
<checkSumAdjustment value="0xf43664b4"/> <checkSumAdjustment value="0x4b2d3480"/>
<magicNumber value="0x5f0f3cf5"/> <magicNumber value="0x5f0f3cf5"/>
<flags value="00000000 00000011"/> <flags value="00000000 00000011"/>
<unitsPerEm value="1000"/> <unitsPerEm value="1000"/>
<created value="Tue Mar 15 19:50:39 2016"/> <created value="Tue Mar 15 19:50:39 2016"/>
<modified value="Tue May 21 16:23:19 2019"/> <modified value="Thu Oct 17 14:43:10 2019"/>
<xMin value="0"/> <xMin value="0"/>
<yMin value="0"/> <yMin value="0"/>
<xMax value="638"/> <xMax value="638"/>
@ -238,6 +238,15 @@
</glyf> </glyf>
<name> <name>
<namerecord nameID="256" platformID="1" platEncID="0" langID="0x0" unicode="True">
Weight
</namerecord>
<namerecord nameID="257" platformID="1" platEncID="0" langID="0x0" unicode="True">
Width
</namerecord>
<namerecord nameID="261" platformID="1" platEncID="0" langID="0x0" unicode="True">
Regular
</namerecord>
<namerecord nameID="0" platformID="3" platEncID="1" langID="0x409"> <namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
Copyright 2015 Google Inc. All Rights Reserved. Copyright 2015 Google Inc. All Rights Reserved.
</namerecord> </namerecord>
@ -283,6 +292,15 @@
<namerecord nameID="14" platformID="3" platEncID="1" langID="0x409"> <namerecord nameID="14" platformID="3" platEncID="1" langID="0x409">
http://scripts.sil.org/OFL http://scripts.sil.org/OFL
</namerecord> </namerecord>
<namerecord nameID="256" platformID="3" platEncID="1" langID="0x409">
Weight
</namerecord>
<namerecord nameID="257" platformID="3" platEncID="1" langID="0x409">
Width
</namerecord>
<namerecord nameID="261" platformID="3" platEncID="1" langID="0x409">
Regular
</namerecord>
</name> </name>
<post> <post>
@ -481,4 +499,41 @@
</LookupList> </LookupList>
</GSUB> </GSUB>
<STAT>
<Version value="0x00010001"/>
<DesignAxisRecordSize value="8"/>
<!-- DesignAxisCount=2 -->
<DesignAxisRecord>
<Axis index="0">
<AxisTag value="wght"/>
<AxisNameID value="256"/> <!-- Weight -->
<AxisOrdering value="1"/>
</Axis>
<Axis index="1">
<AxisTag value="wdth"/>
<AxisNameID value="257"/> <!-- Width -->
<AxisOrdering value="0"/>
</Axis>
</DesignAxisRecord>
<!-- AxisValueCount=2 -->
<AxisValueArray>
<AxisValue index="0" Format="3">
<AxisIndex value="0"/>
<Flags value="2"/>
<ValueNameID value="261"/> <!-- Regular -->
<Value value="400.0"/>
<LinkedValue value="700.0"/>
</AxisValue>
<AxisValue index="1" Format="2">
<AxisIndex value="1"/>
<Flags value="2"/>
<ValueNameID value="261"/> <!-- Regular -->
<NominalValue value="100.0"/>
<RangeMinValue value="93.75"/>
<RangeMaxValue value="100.0"/>
</AxisValue>
</AxisValueArray>
<ElidedFallbackNameID value="2"/> <!-- Regular -->
</STAT>
</ttFont> </ttFont>

View File

@ -14,12 +14,12 @@
<!-- Most of this table will be recalculated by the compiler --> <!-- Most of this table will be recalculated by the compiler -->
<tableVersion value="1.0"/> <tableVersion value="1.0"/>
<fontRevision value="2.001"/> <fontRevision value="2.001"/>
<checkSumAdjustment value="0xd9290bac"/> <checkSumAdjustment value="0x39ab2622"/>
<magicNumber value="0x5f0f3cf5"/> <magicNumber value="0x5f0f3cf5"/>
<flags value="00000000 00000011"/> <flags value="00000000 00000011"/>
<unitsPerEm value="1000"/> <unitsPerEm value="1000"/>
<created value="Tue Mar 15 19:50:39 2016"/> <created value="Tue Mar 15 19:50:39 2016"/>
<modified value="Tue May 21 16:23:19 2019"/> <modified value="Thu Oct 17 14:43:10 2019"/>
<xMin value="0"/> <xMin value="0"/>
<yMin value="0"/> <yMin value="0"/>
<xMax value="496"/> <xMax value="496"/>
@ -238,6 +238,18 @@
</glyf> </glyf>
<name> <name>
<namerecord nameID="256" platformID="1" platEncID="0" langID="0x0" unicode="True">
Weight
</namerecord>
<namerecord nameID="257" platformID="1" platEncID="0" langID="0x0" unicode="True">
Width
</namerecord>
<namerecord nameID="261" platformID="1" platEncID="0" langID="0x0" unicode="True">
Regular
</namerecord>
<namerecord nameID="288" platformID="1" platEncID="0" langID="0x0" unicode="True">
ExtraCondensed
</namerecord>
<namerecord nameID="0" platformID="3" platEncID="1" langID="0x409"> <namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
Copyright 2015 Google Inc. All Rights Reserved. Copyright 2015 Google Inc. All Rights Reserved.
</namerecord> </namerecord>
@ -283,6 +295,18 @@
<namerecord nameID="14" platformID="3" platEncID="1" langID="0x409"> <namerecord nameID="14" platformID="3" platEncID="1" langID="0x409">
http://scripts.sil.org/OFL http://scripts.sil.org/OFL
</namerecord> </namerecord>
<namerecord nameID="256" platformID="3" platEncID="1" langID="0x409">
Weight
</namerecord>
<namerecord nameID="257" platformID="3" platEncID="1" langID="0x409">
Width
</namerecord>
<namerecord nameID="261" platformID="3" platEncID="1" langID="0x409">
Regular
</namerecord>
<namerecord nameID="288" platformID="3" platEncID="1" langID="0x409">
ExtraCondensed
</namerecord>
</name> </name>
<post> <post>
@ -481,4 +505,41 @@
</LookupList> </LookupList>
</GSUB> </GSUB>
<STAT>
<Version value="0x00010001"/>
<DesignAxisRecordSize value="8"/>
<!-- DesignAxisCount=2 -->
<DesignAxisRecord>
<Axis index="0">
<AxisTag value="wght"/>
<AxisNameID value="256"/> <!-- Weight -->
<AxisOrdering value="1"/>
</Axis>
<Axis index="1">
<AxisTag value="wdth"/>
<AxisNameID value="257"/> <!-- Width -->
<AxisOrdering value="0"/>
</Axis>
</DesignAxisRecord>
<!-- AxisValueCount=2 -->
<AxisValueArray>
<AxisValue index="0" Format="3">
<AxisIndex value="0"/>
<Flags value="2"/>
<ValueNameID value="261"/> <!-- Regular -->
<Value value="400.0"/>
<LinkedValue value="700.0"/>
</AxisValue>
<AxisValue index="1" Format="2">
<AxisIndex value="1"/>
<Flags value="0"/>
<ValueNameID value="288"/> <!-- ExtraCondensed -->
<NominalValue value="62.5"/>
<RangeMinValue value="62.5"/>
<RangeMaxValue value="68.75"/>
</AxisValue>
</AxisValueArray>
<ElidedFallbackNameID value="2"/> <!-- Regular -->
</STAT>
</ttFont> </ttFont>

View File

@ -14,12 +14,12 @@
<!-- Most of this table will be recalculated by the compiler --> <!-- Most of this table will be recalculated by the compiler -->
<tableVersion value="1.0"/> <tableVersion value="1.0"/>
<fontRevision value="2.001"/> <fontRevision value="2.001"/>
<checkSumAdjustment value="0xa514fda"/> <checkSumAdjustment value="0x7b5e7903"/>
<magicNumber value="0x5f0f3cf5"/> <magicNumber value="0x5f0f3cf5"/>
<flags value="00000000 00000011"/> <flags value="00000000 00000011"/>
<unitsPerEm value="1000"/> <unitsPerEm value="1000"/>
<created value="Tue Mar 15 19:50:39 2016"/> <created value="Tue Mar 15 19:50:39 2016"/>
<modified value="Tue May 21 16:23:19 2019"/> <modified value="Thu Oct 17 14:43:10 2019"/>
<xMin value="0"/> <xMin value="0"/>
<yMin value="0"/> <yMin value="0"/>
<xMax value="726"/> <xMax value="726"/>
@ -238,6 +238,18 @@
</glyf> </glyf>
<name> <name>
<namerecord nameID="256" platformID="1" platEncID="0" langID="0x0" unicode="True">
Weight
</namerecord>
<namerecord nameID="257" platformID="1" platEncID="0" langID="0x0" unicode="True">
Width
</namerecord>
<namerecord nameID="261" platformID="1" platEncID="0" langID="0x0" unicode="True">
Regular
</namerecord>
<namerecord nameID="266" platformID="1" platEncID="0" langID="0x0" unicode="True">
Black
</namerecord>
<namerecord nameID="0" platformID="3" platEncID="1" langID="0x409"> <namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
Copyright 2015 Google Inc. All Rights Reserved. Copyright 2015 Google Inc. All Rights Reserved.
</namerecord> </namerecord>
@ -283,6 +295,18 @@
<namerecord nameID="14" platformID="3" platEncID="1" langID="0x409"> <namerecord nameID="14" platformID="3" platEncID="1" langID="0x409">
http://scripts.sil.org/OFL http://scripts.sil.org/OFL
</namerecord> </namerecord>
<namerecord nameID="256" platformID="3" platEncID="1" langID="0x409">
Weight
</namerecord>
<namerecord nameID="257" platformID="3" platEncID="1" langID="0x409">
Width
</namerecord>
<namerecord nameID="261" platformID="3" platEncID="1" langID="0x409">
Regular
</namerecord>
<namerecord nameID="266" platformID="3" platEncID="1" langID="0x409">
Black
</namerecord>
</name> </name>
<post> <post>
@ -481,4 +505,40 @@
</LookupList> </LookupList>
</GSUB> </GSUB>
<STAT>
<Version value="0x00010001"/>
<DesignAxisRecordSize value="8"/>
<!-- DesignAxisCount=2 -->
<DesignAxisRecord>
<Axis index="0">
<AxisTag value="wght"/>
<AxisNameID value="256"/> <!-- Weight -->
<AxisOrdering value="1"/>
</Axis>
<Axis index="1">
<AxisTag value="wdth"/>
<AxisNameID value="257"/> <!-- Width -->
<AxisOrdering value="0"/>
</Axis>
</DesignAxisRecord>
<!-- AxisValueCount=2 -->
<AxisValueArray>
<AxisValue index="0" Format="1">
<AxisIndex value="0"/>
<Flags value="0"/>
<ValueNameID value="266"/> <!-- Black -->
<Value value="900.0"/>
</AxisValue>
<AxisValue index="1" Format="2">
<AxisIndex value="1"/>
<Flags value="2"/>
<ValueNameID value="261"/> <!-- Regular -->
<NominalValue value="100.0"/>
<RangeMinValue value="93.75"/>
<RangeMaxValue value="100.0"/>
</AxisValue>
</AxisValueArray>
<ElidedFallbackNameID value="2"/> <!-- Regular -->
</STAT>
</ttFont> </ttFont>

View File

@ -14,12 +14,12 @@
<!-- Most of this table will be recalculated by the compiler --> <!-- Most of this table will be recalculated by the compiler -->
<tableVersion value="1.0"/> <tableVersion value="1.0"/>
<fontRevision value="2.001"/> <fontRevision value="2.001"/>
<checkSumAdjustment value="0xc8e8b846"/> <checkSumAdjustment value="0x7f9149e4"/>
<magicNumber value="0x5f0f3cf5"/> <magicNumber value="0x5f0f3cf5"/>
<flags value="00000000 00000011"/> <flags value="00000000 00000011"/>
<unitsPerEm value="1000"/> <unitsPerEm value="1000"/>
<created value="Tue Mar 15 19:50:39 2016"/> <created value="Tue Mar 15 19:50:39 2016"/>
<modified value="Tue May 21 16:23:19 2019"/> <modified value="Thu Oct 17 14:43:10 2019"/>
<xMin value="0"/> <xMin value="0"/>
<yMin value="0"/> <yMin value="0"/>
<xMax value="574"/> <xMax value="574"/>
@ -238,6 +238,18 @@
</glyf> </glyf>
<name> <name>
<namerecord nameID="256" platformID="1" platEncID="0" langID="0x0" unicode="True">
Weight
</namerecord>
<namerecord nameID="257" platformID="1" platEncID="0" langID="0x0" unicode="True">
Width
</namerecord>
<namerecord nameID="266" platformID="1" platEncID="0" langID="0x0" unicode="True">
Black
</namerecord>
<namerecord nameID="288" platformID="1" platEncID="0" langID="0x0" unicode="True">
ExtraCondensed
</namerecord>
<namerecord nameID="0" platformID="3" platEncID="1" langID="0x409"> <namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
Copyright 2015 Google Inc. All Rights Reserved. Copyright 2015 Google Inc. All Rights Reserved.
</namerecord> </namerecord>
@ -283,6 +295,18 @@
<namerecord nameID="14" platformID="3" platEncID="1" langID="0x409"> <namerecord nameID="14" platformID="3" platEncID="1" langID="0x409">
http://scripts.sil.org/OFL http://scripts.sil.org/OFL
</namerecord> </namerecord>
<namerecord nameID="256" platformID="3" platEncID="1" langID="0x409">
Weight
</namerecord>
<namerecord nameID="257" platformID="3" platEncID="1" langID="0x409">
Width
</namerecord>
<namerecord nameID="266" platformID="3" platEncID="1" langID="0x409">
Black
</namerecord>
<namerecord nameID="288" platformID="3" platEncID="1" langID="0x409">
ExtraCondensed
</namerecord>
</name> </name>
<post> <post>
@ -481,4 +505,40 @@
</LookupList> </LookupList>
</GSUB> </GSUB>
<STAT>
<Version value="0x00010001"/>
<DesignAxisRecordSize value="8"/>
<!-- DesignAxisCount=2 -->
<DesignAxisRecord>
<Axis index="0">
<AxisTag value="wght"/>
<AxisNameID value="256"/> <!-- Weight -->
<AxisOrdering value="1"/>
</Axis>
<Axis index="1">
<AxisTag value="wdth"/>
<AxisNameID value="257"/> <!-- Width -->
<AxisOrdering value="0"/>
</Axis>
</DesignAxisRecord>
<!-- AxisValueCount=2 -->
<AxisValueArray>
<AxisValue index="0" Format="1">
<AxisIndex value="0"/>
<Flags value="0"/>
<ValueNameID value="266"/> <!-- Black -->
<Value value="900.0"/>
</AxisValue>
<AxisValue index="1" Format="2">
<AxisIndex value="1"/>
<Flags value="0"/>
<ValueNameID value="288"/> <!-- ExtraCondensed -->
<NominalValue value="62.5"/>
<RangeMinValue value="62.5"/>
<RangeMaxValue value="68.75"/>
</AxisValue>
</AxisValueArray>
<ElidedFallbackNameID value="2"/> <!-- Regular -->
</STAT>
</ttFont> </ttFont>

View File

@ -1189,7 +1189,7 @@ class InstantiateSTATTest(object):
@pytest.mark.parametrize( @pytest.mark.parametrize(
"location, expected", "location, expected",
[ [
({"wght": 400}, ["Condensed", "Upright"]), ({"wght": 400}, ["Regular", "Condensed", "Upright"]),
({"wdth": 100}, ["Thin", "Regular", "Black", "Upright"]), ({"wdth": 100}, ["Thin", "Regular", "Black", "Upright"]),
], ],
) )
@ -1199,7 +1199,7 @@ class InstantiateSTATTest(object):
stat = varfont["STAT"].table stat = varfont["STAT"].table
designAxes = {a.AxisTag for a in stat.DesignAxisRecord.Axis} designAxes = {a.AxisTag for a in stat.DesignAxisRecord.Axis}
assert designAxes == {"wght", "wdth", "ital"}.difference(location) assert designAxes == {"wght", "wdth", "ital"}
name = varfont["name"] name = varfont["name"]
valueNames = [] valueNames = []
@ -1209,7 +1209,23 @@ class InstantiateSTATTest(object):
assert valueNames == expected assert valueNames == expected
def test_skip_empty_table(self, varfont): def test_skip_table_no_axis_value_array(self, varfont):
varfont["STAT"].table.AxisValueArray = None
instancer.instantiateSTAT(varfont, {"wght": 100})
assert len(varfont["STAT"].table.DesignAxisRecord.Axis) == 3
assert varfont["STAT"].table.AxisValueArray is None
def test_skip_table_axis_value_array_empty(self, varfont):
varfont["STAT"].table.AxisValueArray.AxisValue = []
instancer.instantiateSTAT(varfont, {"wght": 100})
assert len(varfont["STAT"].table.DesignAxisRecord.Axis) == 3
assert not varfont["STAT"].table.AxisValueArray.AxisValue
def test_skip_table_no_design_axes(self, varfont):
stat = otTables.STAT() stat = otTables.STAT()
stat.Version = 0x00010001 stat.Version = 0x00010001
stat.populateDefaults() stat.populateDefaults()
@ -1221,21 +1237,88 @@ class InstantiateSTATTest(object):
assert not varfont["STAT"].table.DesignAxisRecord assert not varfont["STAT"].table.DesignAxisRecord
def test_drop_table(self, varfont): @staticmethod
stat = otTables.STAT() def get_STAT_axis_values(stat):
stat.Version = 0x00010001 axes = stat.DesignAxisRecord.Axis
stat.populateDefaults() result = []
stat.DesignAxisRecord = otTables.AxisRecordArray() for axisValue in stat.AxisValueArray.AxisValue:
axis = otTables.AxisRecord() if axisValue.Format == 1:
axis.AxisTag = "wght" result.append((axes[axisValue.AxisIndex].AxisTag, axisValue.Value))
axis.AxisNameID = 0 elif axisValue.Format == 3:
axis.AxisOrdering = 0 result.append(
stat.DesignAxisRecord.Axis = [axis] (
varfont["STAT"].table = stat axes[axisValue.AxisIndex].AxisTag,
(axisValue.Value, axisValue.LinkedValue),
)
)
elif axisValue.Format == 2:
result.append(
(
axes[axisValue.AxisIndex].AxisTag,
(
axisValue.RangeMinValue,
axisValue.NominalValue,
axisValue.RangeMaxValue,
),
)
)
elif axisValue.Format == 4:
result.append(
tuple(
(axes[rec.AxisIndex].AxisTag, rec.Value)
for rec in axisValue.AxisValueRecord
)
)
else:
raise AssertionError(axisValue.Format)
return result
instancer.instantiateSTAT(varfont, {"wght": 100}) def test_limit_axes(self, varfont2):
instancer.instantiateSTAT(varfont2, {"wght": (400, 500), "wdth": (75, 100)})
assert "STAT" not in varfont assert len(varfont2["STAT"].table.AxisValueArray.AxisValue) == 5
assert self.get_STAT_axis_values(varfont2["STAT"].table) == [
("wght", (400.0, 700.0)),
("wght", 500.0),
("wdth", (93.75, 100.0, 100.0)),
("wdth", (81.25, 87.5, 93.75)),
("wdth", (68.75, 75.0, 81.25)),
]
def test_limit_axis_value_format_4(self, varfont2):
stat = varfont2["STAT"].table
axisValue = otTables.AxisValue()
axisValue.Format = 4
axisValue.AxisValueRecord = []
for tag, value in (("wght", 575), ("wdth", 90)):
rec = otTables.AxisValueRecord()
rec.AxisIndex = next(
i for i, a in enumerate(stat.DesignAxisRecord.Axis) if a.AxisTag == tag
)
rec.Value = value
axisValue.AxisValueRecord.append(rec)
stat.AxisValueArray.AxisValue.append(axisValue)
instancer.instantiateSTAT(varfont2, {"wght": (100, 600)})
assert axisValue in varfont2["STAT"].table.AxisValueArray.AxisValue
instancer.instantiateSTAT(varfont2, {"wdth": (62.5, 87.5)})
assert axisValue not in varfont2["STAT"].table.AxisValueArray.AxisValue
def test_unknown_axis_value_format(self, varfont2, caplog):
stat = varfont2["STAT"].table
axisValue = otTables.AxisValue()
axisValue.Format = 5
stat.AxisValueArray.AxisValue.append(axisValue)
with caplog.at_level(logging.WARNING, logger="fontTools.varLib.instancer"):
instancer.instantiateSTAT(varfont2, {"wght": 400})
assert "Unknown AxisValue table format (5)" in caplog.text
assert axisValue in varfont2["STAT"].table.AxisValueArray.AxisValue
def test_pruningUnusedNames(varfont): def test_pruningUnusedNames(varfont):