Skip to content

Commit

Permalink
Merge pull request #1184 from googlefonts/inline-format-4-sub-lookup-…
Browse files Browse the repository at this point in the history
…test

[fea-rs] Add test case for inline format 4 sub rules
  • Loading branch information
rsheeter authored Dec 9, 2024
2 parents 66542e8 + 51a454e commit 5012a93
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
feature test {
# we should only produce two lookups: one contextual, and one ligature,
# with the ligature containing `l o -> z` and `L o` -> Z
sub l' o' l by z;
sub L' o' L by Z;
} test;
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<ttFont>

<GSUB>
<Version value="0x00010000"/>
<ScriptList>
<!-- ScriptCount=1 -->
<ScriptRecord index="0">
<ScriptTag value="DFLT"/>
<Script>
<DefaultLangSys>
<ReqFeatureIndex value="65535"/>
<!-- FeatureCount=1 -->
<FeatureIndex index="0" value="0"/>
</DefaultLangSys>
<!-- LangSysCount=0 -->
</Script>
</ScriptRecord>
</ScriptList>
<FeatureList>
<!-- FeatureCount=1 -->
<FeatureRecord index="0">
<FeatureTag value="test"/>
<Feature>
<!-- LookupCount=1 -->
<LookupListIndex index="0" value="0"/>
</Feature>
</FeatureRecord>
</FeatureList>
<LookupList>
<!-- LookupCount=2 -->
<Lookup index="0">
<LookupType value="6"/>
<LookupFlag value="0"/>
<!-- SubTableCount=1 -->
<ChainContextSubst index="0" Format="1">
<Coverage>
<Glyph value="L"/>
<Glyph value="l"/>
</Coverage>
<!-- ChainSubRuleSetCount=2 -->
<ChainSubRuleSet index="0">
<!-- ChainSubRuleCount=1 -->
<ChainSubRule index="0">
<!-- BacktrackGlyphCount=0 -->
<!-- InputGlyphCount=2 -->
<Input index="0" value="o"/>
<!-- LookAheadGlyphCount=1 -->
<LookAhead index="0" value="L"/>
<!-- SubstCount=1 -->
<SubstLookupRecord index="0">
<SequenceIndex value="0"/>
<LookupListIndex value="1"/>
</SubstLookupRecord>
</ChainSubRule>
</ChainSubRuleSet>
<ChainSubRuleSet index="1">
<!-- ChainSubRuleCount=1 -->
<ChainSubRule index="0">
<!-- BacktrackGlyphCount=0 -->
<!-- InputGlyphCount=2 -->
<Input index="0" value="o"/>
<!-- LookAheadGlyphCount=1 -->
<LookAhead index="0" value="l"/>
<!-- SubstCount=1 -->
<SubstLookupRecord index="0">
<SequenceIndex value="0"/>
<LookupListIndex value="1"/>
</SubstLookupRecord>
</ChainSubRule>
</ChainSubRuleSet>
</ChainContextSubst>
</Lookup>
<Lookup index="1">
<LookupType value="4"/>
<LookupFlag value="0"/>
<!-- SubTableCount=1 -->
<LigatureSubst index="0">
<LigatureSet glyph="L">
<Ligature components="o" glyph="Z"/>
</LigatureSet>
<LigatureSet glyph="l">
<Ligature components="o" glyph="z"/>
</LigatureSet>
</LigatureSubst>
</Lookup>
</LookupList>
</GSUB>

</ttFont>

0 comments on commit 5012a93

Please sign in to comment.