[instancer/CFF2] Yet another test

This commit is contained in:
Behdad Esfahbod 2024-05-14 14:04:12 -06:00
parent 267fa79cca
commit 17474e19a4
3 changed files with 499 additions and 1 deletions

View File

@ -0,0 +1,497 @@
<?xml version="1.0" encoding="UTF-8"?>
<ttFont sfntVersion="OTTO" ttLibVersion="4.51">
<GlyphOrder>
<!-- The 'id' attribute is only for humans; it is ignored when parsed. -->
<GlyphID id="0" name=".notdef"/>
<GlyphID id="1" name="hyphen"/>
</GlyphOrder>
<head>
<!-- Most of this table will be recalculated by the compiler -->
<tableVersion value="1.0"/>
<fontRevision value="2.004"/>
<checkSumAdjustment value="0xe123fa9"/>
<magicNumber value="0x5f0f3cf5"/>
<flags value="00000000 00000011"/>
<unitsPerEm value="1000"/>
<created value="Thu Apr 29 17:39:47 2021"/>
<modified value="Tue May 14 20:02:30 2024"/>
<xMin value="46"/>
<yMin value="245"/>
<xMax value="302"/>
<yMax value="315"/>
<macStyle value="00000000 00000000"/>
<lowestRecPPEM value="3"/>
<fontDirectionHint value="2"/>
<indexToLocFormat value="0"/>
<glyphDataFormat value="0"/>
</head>
<hhea>
<tableVersion value="0x00010000"/>
<ascent value="1160"/>
<descent value="-288"/>
<lineGap value="0"/>
<advanceWidthMax value="1000"/>
<minLeftSideBearing value="44"/>
<minRightSideBearing value="47"/>
<xMaxExtent value="300"/>
<caretSlopeRise value="1"/>
<caretSlopeRun value="0"/>
<caretOffset value="0"/>
<reserved0 value="0"/>
<reserved1 value="0"/>
<reserved2 value="0"/>
<reserved3 value="0"/>
<metricDataFormat value="0"/>
<numberOfHMetrics value="2"/>
</hhea>
<maxp>
<tableVersion value="0x5000"/>
<numGlyphs value="2"/>
</maxp>
<OS_2>
<!-- The fields 'usFirstCharIndex' and 'usLastCharIndex'
will be recalculated by the compiler -->
<version value="3"/>
<xAvgCharWidth value="674"/>
<usWeightClass value="400"/>
<usWidthClass value="5"/>
<fsType value="00000000 00000000"/>
<ySubscriptXSize value="650"/>
<ySubscriptYSize value="600"/>
<ySubscriptXOffset value="0"/>
<ySubscriptYOffset value="75"/>
<ySuperscriptXSize value="650"/>
<ySuperscriptYSize value="600"/>
<ySuperscriptXOffset value="0"/>
<ySuperscriptYOffset value="350"/>
<yStrikeoutSize value="50"/>
<yStrikeoutPosition value="325"/>
<sFamilyClass value="0"/>
<panose>
<bFamilyType value="2"/>
<bSerifStyle value="11"/>
<bWeight value="2"/>
<bProportion value="0"/>
<bContrast value="0"/>
<bStrokeVariation value="0"/>
<bArmStyle value="0"/>
<bLetterForm value="0"/>
<bMidline value="0"/>
<bXHeight value="0"/>
</panose>
<ulUnicodeRange1 value="00000000 00000000 00000000 00000001"/>
<ulUnicodeRange2 value="00000000 00000000 00000000 00000000"/>
<ulUnicodeRange3 value="00000000 00000000 00000000 00000000"/>
<ulUnicodeRange4 value="00000000 00000000 00000000 00000000"/>
<achVendID value="ADBO"/>
<fsSelection value="00000000 00000000"/>
<usFirstCharIndex value="45"/>
<usLastCharIndex value="45"/>
<sTypoAscender value="880"/>
<sTypoDescender value="-120"/>
<sTypoLineGap value="0"/>
<usWinAscent value="1160"/>
<usWinDescent value="288"/>
<ulCodePageRange1 value="00000000 00000000 00000000 00000001"/>
<ulCodePageRange2 value="00000000 00000000 00000000 00000000"/>
<sxHeight value="543"/>
<sCapHeight value="733"/>
<usDefaultChar value="0"/>
<usBreakChar value="32"/>
<usMaxContext value="6"/>
</OS_2>
<hmtx>
<mtx name=".notdef" width="1000" lsb="100"/>
<mtx name="hyphen" width="347" lsb="44"/>
</hmtx>
<cmap>
<tableVersion version="0"/>
<cmap_format_4 platformID="0" platEncID="3" language="0">
<map code="0x2d" name="hyphen"/><!-- HYPHEN-MINUS -->
</cmap_format_4>
<cmap_format_4 platformID="3" platEncID="1" language="0">
<map code="0x2d" name="hyphen"/><!-- HYPHEN-MINUS -->
</cmap_format_4>
</cmap>
<name>
<namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
© 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'.
</namerecord>
<namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
Noto Sans SC
</namerecord>
<namerecord nameID="2" platformID="3" platEncID="1" langID="0x409">
Regular
</namerecord>
<namerecord nameID="3" platformID="3" platEncID="1" langID="0x409">
2.004;ADBO;NotoSansSC-Thin;ADOBE
</namerecord>
<namerecord nameID="4" platformID="3" platEncID="1" langID="0x409">
Noto Sans SC
</namerecord>
<namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
Version 2.004;hotconv 1.0.118;makeotfexe 2.5.65603
</namerecord>
<namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
NotoSansSC-Thin
</namerecord>
<namerecord nameID="256" platformID="3" platEncID="1" langID="0x409">
Regular
</namerecord>
<namerecord nameID="261" platformID="3" platEncID="1" langID="0x409">
Regular
</namerecord>
<namerecord nameID="265" platformID="3" platEncID="1" langID="0x409">
Weight
</namerecord>
</name>
<post>
<formatType value="3.0"/>
<italicAngle value="0.0"/>
<underlinePosition value="-125"/>
<underlineThickness value="50"/>
<isFixedPitch value="0"/>
<minMemType42 value="0"/>
<maxMemType42 value="0"/>
<minMemType1 value="0"/>
<maxMemType1 value="0"/>
</post>
<CFF2>
<major value="2"/>
<minor value="0"/>
<CFFFont name="CFF2Font">
<FontMatrix value="0.001 0 0 0.001 0 0"/>
<FDSelect format="0"/>
<FDArray>
<FontDict index="0">
<Private>
<BlueValues value="-250 -250 1100 1100"/>
<BlueScale value="0.039625"/>
<BlueShift value="7"/>
<BlueFuzz value="1"/>
<StdHW value="35"/>
<StdVW value="28"/>
<StemSnapV value="28 46"/>
<LanguageGroup value="1"/>
<ExpansionFactor value="0.06"/>
</Private>
</FontDict>
<FontDict index="1">
<Private>
<BlueValues value="-250 -250 1100 1100"/>
<BlueScale value="0.039625"/>
<BlueShift value="7"/>
<BlueFuzz value="1"/>
<StdHW value="35"/>
<StdVW value="28"/>
<StemSnapV value="28 46"/>
<LanguageGroup value="0"/>
<ExpansionFactor value="0.06"/>
</Private>
</FontDict>
</FDArray>
<CharStrings>
<CharString name=".notdef" fdSelectIndex="0">
</CharString>
<CharString name="hyphen" fdSelectIndex="1">
46 245 rmoveto
256 70 -256 hlineto
</CharString>
</CharStrings>
<VarStore Format="1">
<Format value="1"/>
<VarRegionList>
<!-- RegionAxisCount=1 -->
<!-- RegionCount=1 -->
<Region index="0">
<VarRegionAxis index="0">
<StartCoord value="0.0"/>
<PeakCoord value="1.0"/>
<EndCoord value="1.0"/>
</VarRegionAxis>
</Region>
</VarRegionList>
<!-- VarDataCount=1 -->
<VarData index="0">
<!-- ItemCount=0 -->
<NumShorts value="0"/>
<!-- VarRegionCount=1 -->
<VarRegionIndex index="0" value="0"/>
</VarData>
</VarStore>
</CFFFont>
<GlobalSubrs>
<!-- The 'index' attribute is only for humans; it is ignored when parsed. -->
</GlobalSubrs>
</CFF2>
<GPOS>
<Version value="0x00010000"/>
<ScriptList>
<!-- ScriptCount=6 -->
<ScriptRecord index="0">
<ScriptTag value="DFLT"/>
<Script>
<DefaultLangSys>
<ReqFeatureIndex value="65535"/>
<!-- FeatureCount=1 -->
<FeatureIndex index="0" value="0"/>
</DefaultLangSys>
<!-- LangSysCount=0 -->
</Script>
</ScriptRecord>
<ScriptRecord index="1">
<ScriptTag value="cyrl"/>
<Script>
<DefaultLangSys>
<ReqFeatureIndex value="65535"/>
<!-- FeatureCount=1 -->
<FeatureIndex index="0" value="1"/>
</DefaultLangSys>
<!-- LangSysCount=0 -->
</Script>
</ScriptRecord>
<ScriptRecord index="2">
<ScriptTag value="grek"/>
<Script>
<DefaultLangSys>
<ReqFeatureIndex value="65535"/>
<!-- FeatureCount=1 -->
<FeatureIndex index="0" value="2"/>
</DefaultLangSys>
<!-- LangSysCount=0 -->
</Script>
</ScriptRecord>
<ScriptRecord index="3">
<ScriptTag value="hani"/>
<Script>
<DefaultLangSys>
<ReqFeatureIndex value="65535"/>
<!-- FeatureCount=1 -->
<FeatureIndex index="0" value="3"/>
</DefaultLangSys>
<!-- LangSysCount=0 -->
</Script>
</ScriptRecord>
<ScriptRecord index="4">
<ScriptTag value="kana"/>
<Script>
<DefaultLangSys>
<ReqFeatureIndex value="65535"/>
<!-- FeatureCount=1 -->
<FeatureIndex index="0" value="4"/>
</DefaultLangSys>
<!-- LangSysCount=0 -->
</Script>
</ScriptRecord>
<ScriptRecord index="5">
<ScriptTag value="latn"/>
<Script>
<DefaultLangSys>
<ReqFeatureIndex value="65535"/>
<!-- FeatureCount=1 -->
<FeatureIndex index="0" value="5"/>
</DefaultLangSys>
<!-- LangSysCount=0 -->
</Script>
</ScriptRecord>
</ScriptList>
<FeatureList>
<!-- FeatureCount=6 -->
<FeatureRecord index="0">
<FeatureTag value="kern"/>
<Feature>
<!-- LookupCount=1 -->
<LookupListIndex index="0" value="0"/>
</Feature>
</FeatureRecord>
<FeatureRecord index="1">
<FeatureTag value="kern"/>
<Feature>
<!-- LookupCount=1 -->
<LookupListIndex index="0" value="0"/>
</Feature>
</FeatureRecord>
<FeatureRecord index="2">
<FeatureTag value="kern"/>
<Feature>
<!-- LookupCount=1 -->
<LookupListIndex index="0" value="0"/>
</Feature>
</FeatureRecord>
<FeatureRecord index="3">
<FeatureTag value="kern"/>
<Feature>
<!-- LookupCount=1 -->
<LookupListIndex index="0" value="0"/>
</Feature>
</FeatureRecord>
<FeatureRecord index="4">
<FeatureTag value="kern"/>
<Feature>
<!-- LookupCount=1 -->
<LookupListIndex index="0" value="0"/>
</Feature>
</FeatureRecord>
<FeatureRecord index="5">
<FeatureTag value="kern"/>
<Feature>
<!-- LookupCount=1 -->
<LookupListIndex index="0" value="0"/>
</Feature>
</FeatureRecord>
</FeatureList>
<LookupList>
<!-- LookupCount=1 -->
<Lookup index="0">
<LookupType value="2"/>
<LookupFlag value="0"/>
<!-- SubTableCount=1 -->
<PairPos index="0" Format="2">
<Coverage>
<Glyph value="hyphen"/>
</Coverage>
<ValueFormat1 value="68"/>
<ValueFormat2 value="0"/>
<ClassDef1>
</ClassDef1>
<ClassDef2>
<ClassDef glyph="hyphen" class="1"/>
</ClassDef2>
<!-- Class1Count=1 -->
<!-- Class2Count=2 -->
<Class1Record index="0">
<Class2Record index="0">
<Value1 XAdvance="0"/>
</Class2Record>
<Class2Record index="1">
<Value1 XAdvance="0"/>
</Class2Record>
</Class1Record>
</PairPos>
</Lookup>
</LookupList>
</GPOS>
<GSUB>
<Version value="0x00010000"/>
<ScriptList>
<!-- ScriptCount=6 -->
<ScriptRecord index="0">
<ScriptTag value="DFLT"/>
<Script>
<DefaultLangSys>
<ReqFeatureIndex value="65535"/>
<!-- FeatureCount=0 -->
</DefaultLangSys>
<!-- LangSysCount=0 -->
</Script>
</ScriptRecord>
<ScriptRecord index="1">
<ScriptTag value="cyrl"/>
<Script>
<!-- LangSysCount=0 -->
</Script>
</ScriptRecord>
<ScriptRecord index="2">
<ScriptTag value="grek"/>
<Script>
<!-- LangSysCount=0 -->
</Script>
</ScriptRecord>
<ScriptRecord index="3">
<ScriptTag value="hani"/>
<Script>
<!-- LangSysCount=0 -->
</Script>
</ScriptRecord>
<ScriptRecord index="4">
<ScriptTag value="kana"/>
<Script>
<!-- LangSysCount=0 -->
</Script>
</ScriptRecord>
<ScriptRecord index="5">
<ScriptTag value="latn"/>
<Script>
<!-- LangSysCount=0 -->
</Script>
</ScriptRecord>
</ScriptList>
<FeatureList>
<!-- FeatureCount=0 -->
</FeatureList>
<LookupList>
<!-- LookupCount=0 -->
</LookupList>
</GSUB>
<STAT>
<Version value="0x00010001"/>
<DesignAxisRecordSize value="8"/>
<!-- DesignAxisCount=1 -->
<DesignAxisRecord>
<Axis index="0">
<AxisTag value="wght"/>
<AxisNameID value="265"/> <!-- Weight -->
<AxisOrdering value="0"/>
</Axis>
</DesignAxisRecord>
<!-- AxisValueCount=1 -->
<AxisValueArray>
<AxisValue index="0" Format="2">
<AxisIndex value="0"/>
<Flags value="2"/> <!-- ElidableAxisValueName -->
<ValueNameID value="261"/> <!-- Regular -->
<NominalValue value="400.0"/>
<RangeMinValue value="400.0"/>
<RangeMaxValue value="499.0"/>
</AxisValue>
</AxisValueArray>
<ElidedFallbackNameID value="256"/> <!-- Regular -->
</STAT>
<VORG>
<majorVersion value="1"/>
<minorVersion value="0"/>
<defaultVertOriginY value="880"/>
<numVertOriginYMetrics value="0"/>
</VORG>
<vhea>
<tableVersion value="0x00011000"/>
<ascent value="500"/>
<descent value="-500"/>
<lineGap value="0"/>
<advanceHeightMax value="1000"/>
<minTopSideBearing value="589"/>
<minBottomSideBearing value="341"/>
<yMaxExtent value="659"/>
<caretSlopeRise value="0"/>
<caretSlopeRun value="1"/>
<caretOffset value="0"/>
<reserved1 value="0"/>
<reserved2 value="0"/>
<reserved3 value="0"/>
<reserved4 value="0"/>
<metricDataFormat value="0"/>
<numberOfVMetrics value="1"/>
</vhea>
<vmtx>
<mtx name=".notdef" height="1000" tsb="0"/>
<mtx name="hyphen" height="1000" tsb="589"/>
</vmtx>
</ttFont>

View File

@ -96,7 +96,7 @@ class InstantiateCFF2Test(object):
def test_pin_and_drop_axis(self, varfont, location, expected): def test_pin_and_drop_axis(self, varfont, location, expected):
varfont = ttLib.TTFont() varfont = ttLib.TTFont()
varfont.importXML(os.path.join(TESTDATA, "CFF2Instancer-VF.ttx")) varfont.importXML(os.path.join(TESTDATA, "CFF2Instancer-VF-1.ttx"))
location = instancer.NormalizedAxisLimits(location) location = instancer.NormalizedAxisLimits(location)
@ -109,6 +109,7 @@ class InstantiateCFF2Test(object):
@pytest.mark.parametrize( @pytest.mark.parametrize(
"source_ttx, expected_ttx", "source_ttx, expected_ttx",
[ [
("CFF2Instancer-VF-1.ttx", "CFF2Instancer-VF-1-instance-400.ttx"),
("CFF2Instancer-VF-2.ttx", "CFF2Instancer-VF-2-instance-400.ttx"), ("CFF2Instancer-VF-2.ttx", "CFF2Instancer-VF-2-instance-400.ttx"),
("CFF2Instancer-VF-3.ttx", "CFF2Instancer-VF-3-instance-400.ttx"), ("CFF2Instancer-VF-3.ttx", "CFF2Instancer-VF-3-instance-400.ttx"),
], ],