feaLib: support explicit 'subtable' statements in PairPos lookups
Fixes https://github.com/fonttools/fonttools/issues/1279
This commit is contained in:
parent
d3229d5777
commit
9456ae9485
@ -1077,6 +1077,9 @@ class SubtableStatement(Statement):
|
||||
def __init__(self, location=None):
|
||||
Statement.__init__(self, location)
|
||||
|
||||
def build(self, builder):
|
||||
builder.add_subtable_break(self.location)
|
||||
|
||||
def asFea(self, indent=""):
|
||||
return indent + "subtable;"
|
||||
|
||||
|
@ -999,6 +999,16 @@ class Builder(object):
|
||||
lookup = self.get_lookup_(location, PairPosBuilder)
|
||||
lookup.addClassPair(location, glyphclass1, value1, glyphclass2, value2)
|
||||
|
||||
def add_subtable_break(self, location):
|
||||
if type(self.cur_lookup_) is not PairPosBuilder:
|
||||
raise FeatureLibError(
|
||||
'explicit "subtable" statement is intended for use with only '
|
||||
"Pair Adjustment Positioning Format 2 (i.e. pair class kerning)",
|
||||
location
|
||||
)
|
||||
lookup = self.get_lookup_(location, PairPosBuilder)
|
||||
lookup.add_subtable_break(location)
|
||||
|
||||
def add_specific_pair_pos(self, location, glyph1, value1, glyph2, value2):
|
||||
lookup = self.get_lookup_(location, PairPosBuilder)
|
||||
lookup.addGlyphPair(location, glyph1, value1, glyph2, value2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user