-
Notifications
You must be signed in to change notification settings - Fork 448
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feaLib] Support multiple lookups per glyph position (#1905)
This allows for more than one "lookup ..." chaining statements at each glyph position in a chaining contextual substitution or positioning rule: e.g. sub a b c' lookup lookup1 lookup lookup2 d; The corresponding change in the Adobe OpenType Feature File Specification (and implementation in makeotf) happened in adobe-type-tools/afdko#1132.
- Loading branch information
1 parent
a53bb37
commit b299bfb
Showing
9 changed files
with
251 additions
and
46 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
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
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,11 @@ | ||
lookup a_to_bc { | ||
sub a by b c; | ||
} a_to_bc; | ||
|
||
lookup b_to_d { | ||
sub b by d; | ||
} b_to_d; | ||
|
||
feature test { | ||
sub a' lookup a_to_bc lookup b_to_d b; | ||
} test; |
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,76 @@ | ||
<?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="2"/> | ||
</Feature> | ||
</FeatureRecord> | ||
</FeatureList> | ||
<LookupList> | ||
<!-- LookupCount=3 --> | ||
<Lookup index="0"> | ||
<LookupType value="2"/> | ||
<LookupFlag value="0"/> | ||
<!-- SubTableCount=1 --> | ||
<MultipleSubst index="0"> | ||
<Substitution in="a" out="b,c"/> | ||
</MultipleSubst> | ||
</Lookup> | ||
<Lookup index="1"> | ||
<LookupType value="1"/> | ||
<LookupFlag value="0"/> | ||
<!-- SubTableCount=1 --> | ||
<SingleSubst index="0"> | ||
<Substitution in="b" out="d"/> | ||
</SingleSubst> | ||
</Lookup> | ||
<Lookup index="2"> | ||
<LookupType value="6"/> | ||
<LookupFlag value="0"/> | ||
<!-- SubTableCount=1 --> | ||
<ChainContextSubst index="0" Format="3"> | ||
<!-- BacktrackGlyphCount=0 --> | ||
<!-- InputGlyphCount=1 --> | ||
<InputCoverage index="0"> | ||
<Glyph value="a"/> | ||
</InputCoverage> | ||
<!-- LookAheadGlyphCount=1 --> | ||
<LookAheadCoverage index="0"> | ||
<Glyph value="b"/> | ||
</LookAheadCoverage> | ||
<!-- SubstCount=2 --> | ||
<SubstLookupRecord index="0"> | ||
<SequenceIndex value="0"/> | ||
<LookupListIndex value="0"/> | ||
</SubstLookupRecord> | ||
<SubstLookupRecord index="1"> | ||
<SequenceIndex value="0"/> | ||
<LookupListIndex value="1"/> | ||
</SubstLookupRecord> | ||
</ChainContextSubst> | ||
</Lookup> | ||
</LookupList> | ||
</GSUB> | ||
|
||
</ttFont> |
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,11 @@ | ||
lookup a_reduce_sb { | ||
pos a <-80 0 -160 0>; | ||
} a_reduce_sb; | ||
|
||
lookup a_raise { | ||
pos a <0 100 0 0>; | ||
} a_raise; | ||
|
||
feature test { | ||
pos a' lookup a_reduce_sb lookup a_raise b; | ||
} test; |
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,84 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ttFont> | ||
|
||
<GPOS> | ||
<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="2"/> | ||
</Feature> | ||
</FeatureRecord> | ||
</FeatureList> | ||
<LookupList> | ||
<!-- LookupCount=3 --> | ||
<Lookup index="0"> | ||
<LookupType value="1"/> | ||
<LookupFlag value="0"/> | ||
<!-- SubTableCount=1 --> | ||
<SinglePos index="0" Format="1"> | ||
<Coverage> | ||
<Glyph value="a"/> | ||
</Coverage> | ||
<ValueFormat value="5"/> | ||
<Value XPlacement="-80" XAdvance="-160"/> | ||
</SinglePos> | ||
</Lookup> | ||
<Lookup index="1"> | ||
<LookupType value="1"/> | ||
<LookupFlag value="0"/> | ||
<!-- SubTableCount=1 --> | ||
<SinglePos index="0" Format="1"> | ||
<Coverage> | ||
<Glyph value="a"/> | ||
</Coverage> | ||
<ValueFormat value="2"/> | ||
<Value YPlacement="100"/> | ||
</SinglePos> | ||
</Lookup> | ||
<Lookup index="2"> | ||
<LookupType value="8"/> | ||
<LookupFlag value="0"/> | ||
<!-- SubTableCount=1 --> | ||
<ChainContextPos index="0" Format="3"> | ||
<!-- BacktrackGlyphCount=0 --> | ||
<!-- InputGlyphCount=1 --> | ||
<InputCoverage index="0"> | ||
<Glyph value="a"/> | ||
</InputCoverage> | ||
<!-- LookAheadGlyphCount=1 --> | ||
<LookAheadCoverage index="0"> | ||
<Glyph value="b"/> | ||
</LookAheadCoverage> | ||
<!-- PosCount=2 --> | ||
<PosLookupRecord index="0"> | ||
<SequenceIndex value="0"/> | ||
<LookupListIndex value="0"/> | ||
</PosLookupRecord> | ||
<PosLookupRecord index="1"> | ||
<SequenceIndex value="0"/> | ||
<LookupListIndex value="1"/> | ||
</PosLookupRecord> | ||
</ChainContextPos> | ||
</Lookup> | ||
</LookupList> | ||
</GPOS> | ||
|
||
</ttFont> |
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