This makes the output of feaLib more compact, using a similar technique as seems to be used by makeotf. After this change, feaLib generates output that more similar to makeotf: * For the test cases in `bug512.fea` and `bug463.fea`, feaLib now generates the exact same output as makeotf v2.0.90. * For the test cases in `GSUB_6.fea`, it is hard to say because makeotf crashes on the test file; our test contains language constructs that are valid according to the spec, but didn't yet get implemented by makeotf. When commenting out those constructs, feaLib generates the exact same output as makeotf v2.0.90. * For the test cases in `feature_aalt.fea`, the output of feaLib is now structually the same as the output of makeotf v2.0.90. However, two lookups are in different order. feaLib's ordering reflects the order of statements in the compiled input source; no idea why makeotf would want to reverse the ordering. Since this ordering difference only affects the _targets_ of chain substitutions, there is no semantic difference. Resolves https://github.com/behdad/fonttools/issues/512.
185 lines
5.9 KiB
XML
185 lines
5.9 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<ttFont sfntVersion="true" ttLibVersion="3.0">
|
|
|
|
<GSUB>
|
|
<Version value="1.0"/>
|
|
<ScriptList>
|
|
<!-- ScriptCount=1 -->
|
|
<ScriptRecord index="0">
|
|
<ScriptTag value="DFLT"/>
|
|
<Script>
|
|
<DefaultLangSys>
|
|
<ReqFeatureIndex value="65535"/>
|
|
<!-- FeatureCount=5 -->
|
|
<FeatureIndex index="0" value="0"/>
|
|
<FeatureIndex index="1" value="1"/>
|
|
<FeatureIndex index="2" value="2"/>
|
|
<FeatureIndex index="3" value="3"/>
|
|
<FeatureIndex index="4" value="4"/>
|
|
</DefaultLangSys>
|
|
<!-- LangSysCount=0 -->
|
|
</Script>
|
|
</ScriptRecord>
|
|
</ScriptList>
|
|
<FeatureList>
|
|
<!-- FeatureCount=5 -->
|
|
<FeatureRecord index="0">
|
|
<FeatureTag value="aalt"/>
|
|
<Feature>
|
|
<!-- LookupCount=1 -->
|
|
<LookupListIndex index="0" value="0"/>
|
|
</Feature>
|
|
</FeatureRecord>
|
|
<FeatureRecord index="1">
|
|
<FeatureTag value="frac"/>
|
|
<Feature>
|
|
<!-- LookupCount=1 -->
|
|
<LookupListIndex index="0" value="2"/>
|
|
</Feature>
|
|
</FeatureRecord>
|
|
<FeatureRecord index="2">
|
|
<FeatureTag value="liga"/>
|
|
<Feature>
|
|
<!-- LookupCount=1 -->
|
|
<LookupListIndex index="0" value="5"/>
|
|
</Feature>
|
|
</FeatureRecord>
|
|
<FeatureRecord index="3">
|
|
<FeatureTag value="ordn"/>
|
|
<Feature>
|
|
<!-- LookupCount=1 -->
|
|
<LookupListIndex index="0" value="3"/>
|
|
</Feature>
|
|
</FeatureRecord>
|
|
<FeatureRecord index="4">
|
|
<FeatureTag value="sups"/>
|
|
<Feature>
|
|
<!-- LookupCount=1 -->
|
|
<LookupListIndex index="0" value="1"/>
|
|
</Feature>
|
|
</FeatureRecord>
|
|
</FeatureList>
|
|
<LookupList>
|
|
<!-- LookupCount=6 -->
|
|
<Lookup index="0">
|
|
<!-- LookupType=1 -->
|
|
<LookupFlag value="0"/>
|
|
<!-- SubTableCount=1 -->
|
|
<SingleSubst index="0">
|
|
<Substitution in="A" out="ordfeminine"/>
|
|
<Substitution in="O" out="ordmasculine"/>
|
|
<Substitution in="a" out="ordfeminine"/>
|
|
<Substitution in="o" out="ordmasculine"/>
|
|
<Substitution in="one" out="onesuperior"/>
|
|
<Substitution in="three" out="threesuperior"/>
|
|
<Substitution in="two" out="twosuperior"/>
|
|
</SingleSubst>
|
|
</Lookup>
|
|
<Lookup index="1">
|
|
<!-- LookupType=1 -->
|
|
<LookupFlag value="0"/>
|
|
<!-- SubTableCount=1 -->
|
|
<SingleSubst index="0">
|
|
<Substitution in="one" out="onesuperior"/>
|
|
<Substitution in="three" out="threesuperior"/>
|
|
<Substitution in="two" out="twosuperior"/>
|
|
</SingleSubst>
|
|
</Lookup>
|
|
<Lookup index="2">
|
|
<!-- LookupType=4 -->
|
|
<LookupFlag value="0"/>
|
|
<!-- SubTableCount=1 -->
|
|
<LigatureSubst index="0">
|
|
<LigatureSet glyph="one">
|
|
<Ligature components="slash,four" glyph="onequarter"/>
|
|
<Ligature components="slash,two" glyph="onehalf"/>
|
|
</LigatureSet>
|
|
<LigatureSet glyph="three">
|
|
<Ligature components="slash,four" glyph="threequarters"/>
|
|
</LigatureSet>
|
|
</LigatureSubst>
|
|
</Lookup>
|
|
<Lookup index="3">
|
|
<!-- LookupType=6 -->
|
|
<LookupFlag value="0"/>
|
|
<!-- SubTableCount=2 -->
|
|
<ChainContextSubst index="0" Format="3">
|
|
<!-- BacktrackGlyphCount=1 -->
|
|
<BacktrackCoverage index="0">
|
|
<Glyph value="zero"/>
|
|
<Glyph value="one"/>
|
|
<Glyph value="two"/>
|
|
<Glyph value="three"/>
|
|
<Glyph value="four"/>
|
|
<Glyph value="five"/>
|
|
<Glyph value="six"/>
|
|
<Glyph value="seven"/>
|
|
<Glyph value="eight"/>
|
|
<Glyph value="nine"/>
|
|
</BacktrackCoverage>
|
|
<!-- InputGlyphCount=1 -->
|
|
<InputCoverage index="0">
|
|
<Glyph value="A"/>
|
|
<Glyph value="a"/>
|
|
</InputCoverage>
|
|
<!-- LookAheadGlyphCount=0 -->
|
|
<!-- SubstCount=1 -->
|
|
<SubstLookupRecord index="0">
|
|
<SequenceIndex value="0"/>
|
|
<LookupListIndex value="4"/>
|
|
</SubstLookupRecord>
|
|
</ChainContextSubst>
|
|
<ChainContextSubst index="1" Format="3">
|
|
<!-- BacktrackGlyphCount=1 -->
|
|
<BacktrackCoverage index="0">
|
|
<Glyph value="zero"/>
|
|
<Glyph value="one"/>
|
|
<Glyph value="two"/>
|
|
<Glyph value="three"/>
|
|
<Glyph value="four"/>
|
|
<Glyph value="five"/>
|
|
<Glyph value="six"/>
|
|
<Glyph value="seven"/>
|
|
<Glyph value="eight"/>
|
|
<Glyph value="nine"/>
|
|
</BacktrackCoverage>
|
|
<!-- InputGlyphCount=1 -->
|
|
<InputCoverage index="0">
|
|
<Glyph value="O"/>
|
|
<Glyph value="o"/>
|
|
</InputCoverage>
|
|
<!-- LookAheadGlyphCount=0 -->
|
|
<!-- SubstCount=1 -->
|
|
<SubstLookupRecord index="0">
|
|
<SequenceIndex value="0"/>
|
|
<LookupListIndex value="4"/>
|
|
</SubstLookupRecord>
|
|
</ChainContextSubst>
|
|
</Lookup>
|
|
<Lookup index="4">
|
|
<!-- LookupType=1 -->
|
|
<LookupFlag value="0"/>
|
|
<!-- SubTableCount=1 -->
|
|
<SingleSubst index="0">
|
|
<Substitution in="A" out="ordfeminine"/>
|
|
<Substitution in="O" out="ordmasculine"/>
|
|
<Substitution in="a" out="ordfeminine"/>
|
|
<Substitution in="o" out="ordmasculine"/>
|
|
</SingleSubst>
|
|
</Lookup>
|
|
<Lookup index="5">
|
|
<!-- LookupType=4 -->
|
|
<LookupFlag value="0"/>
|
|
<!-- SubTableCount=1 -->
|
|
<LigatureSubst index="0">
|
|
<LigatureSet glyph="f">
|
|
<Ligature components="i" glyph="f_i"/>
|
|
<Ligature components="l" glyph="f_l"/>
|
|
</LigatureSet>
|
|
</LigatureSubst>
|
|
</Lookup>
|
|
</LookupList>
|
|
</GSUB>
|
|
|
|
</ttFont>
|