-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1271 from googlefonts/gsub-context-format-choice
[fea-rs] Handle edge case in chain context compilation
- Loading branch information
Showing
4 changed files
with
111 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
fea-rs/test-data/compile-tests/mini-latin/good/chain_sub_format_choice.fea
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
feature ccmp { | ||
@one = [a]; | ||
@two = [b]; | ||
|
||
# this should compile to format 1, because the class has only a single glyph | ||
lookup test { | ||
sub @one' @two by @two; | ||
sub @two @one' by @two; | ||
} test; | ||
|
||
} ccmp; | ||
|
79 changes: 79 additions & 0 deletions
79
fea-rs/test-data/compile-tests/mini-latin/good/chain_sub_format_choice.ttx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?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="ccmp"/> | ||
<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="a"/> | ||
</Coverage> | ||
<!-- ChainSubRuleSetCount=1 --> | ||
<ChainSubRuleSet index="0"> | ||
<!-- ChainSubRuleCount=2 --> | ||
<ChainSubRule index="0"> | ||
<!-- BacktrackGlyphCount=0 --> | ||
<!-- InputGlyphCount=1 --> | ||
<!-- LookAheadGlyphCount=1 --> | ||
<LookAhead index="0" value="b"/> | ||
<!-- SubstCount=1 --> | ||
<SubstLookupRecord index="0"> | ||
<SequenceIndex value="0"/> | ||
<LookupListIndex value="1"/> | ||
</SubstLookupRecord> | ||
</ChainSubRule> | ||
<ChainSubRule index="1"> | ||
<!-- BacktrackGlyphCount=1 --> | ||
<Backtrack index="0" value="b"/> | ||
<!-- InputGlyphCount=1 --> | ||
<!-- LookAheadGlyphCount=0 --> | ||
<!-- SubstCount=1 --> | ||
<SubstLookupRecord index="0"> | ||
<SequenceIndex value="0"/> | ||
<LookupListIndex value="1"/> | ||
</SubstLookupRecord> | ||
</ChainSubRule> | ||
</ChainSubRuleSet> | ||
</ChainContextSubst> | ||
</Lookup> | ||
<Lookup index="1"> | ||
<LookupType value="1"/> | ||
<LookupFlag value="0"/> | ||
<!-- SubTableCount=1 --> | ||
<SingleSubst index="0"> | ||
<Substitution in="a" out="b"/> | ||
</SingleSubst> | ||
</Lookup> | ||
</LookupList> | ||
</GSUB> | ||
|
||
</ttFont> |