[feaLib] Synthesize alternate substitutions for feature aalt
After this change, feaLib synthesizes the same lookups as makeotf v2.0.90 for `feature aalt` in the example of section 8.a of the OpenType Feature File specification.
This commit is contained in:
parent
bf79ceb2f2
commit
edb1ed0fcc
@ -141,9 +141,9 @@ class Builder(object):
|
||||
self.add_single_subst(
|
||||
self.aalt_location_, prefix=None, suffix=None, mapping=single)
|
||||
for glyph, repl in multi.items():
|
||||
self.add_multiple_subst(
|
||||
self.add_alternate_subst(
|
||||
self.aalt_location_, prefix=None, glyph=glyph, suffix=None,
|
||||
replacements=repl)
|
||||
replacement=repl)
|
||||
self.end_feature()
|
||||
self.lookups_.extend(old_lookups)
|
||||
|
||||
|
28
Lib/fontTools/feaLib/testdata/spec8a.ttx
vendored
28
Lib/fontTools/feaLib/testdata/spec8a.ttx
vendored
@ -94,15 +94,29 @@
|
||||
</SingleSubst>
|
||||
</Lookup>
|
||||
<Lookup index="1">
|
||||
<!-- LookupType=2 -->
|
||||
<!-- LookupType=3 -->
|
||||
<LookupFlag value="0"/>
|
||||
<!-- SubTableCount=1 -->
|
||||
<MultipleSubst index="0">
|
||||
<Substitution in="a" out="A.sc,a.alt1,a.alt2,a.alt3"/>
|
||||
<Substitution in="b" out="B.sc,b.alt"/>
|
||||
<Substitution in="c" out="C.sc,c.mid"/>
|
||||
<Substitution in="d" out="d.alt,d.mid"/>
|
||||
</MultipleSubst>
|
||||
<AlternateSubst index="0">
|
||||
<AlternateSet glyph="a">
|
||||
<Alternate glyph="A.sc"/>
|
||||
<Alternate glyph="a.alt1"/>
|
||||
<Alternate glyph="a.alt2"/>
|
||||
<Alternate glyph="a.alt3"/>
|
||||
</AlternateSet>
|
||||
<AlternateSet glyph="b">
|
||||
<Alternate glyph="B.sc"/>
|
||||
<Alternate glyph="b.alt"/>
|
||||
</AlternateSet>
|
||||
<AlternateSet glyph="c">
|
||||
<Alternate glyph="C.sc"/>
|
||||
<Alternate glyph="c.mid"/>
|
||||
</AlternateSet>
|
||||
<AlternateSet glyph="d">
|
||||
<Alternate glyph="d.alt"/>
|
||||
<Alternate glyph="d.mid"/>
|
||||
</AlternateSet>
|
||||
</AlternateSubst>
|
||||
</Lookup>
|
||||
<Lookup index="2">
|
||||
<!-- LookupType=1 -->
|
||||
|
Loading…
x
Reference in New Issue
Block a user