[mtiLib] Set LookupType even for empty lookup
This commit is contained in:
parent
7af5f9a343
commit
6380b7041c
@ -821,39 +821,34 @@ def parseLookup(lines, tableTag, font, lookupMap=None):
|
|||||||
|
|
||||||
lookup.LookupType, parseLookupSubTable = {
|
lookup.LookupType, parseLookupSubTable = {
|
||||||
'GSUB': {
|
'GSUB': {
|
||||||
'single': (0, parseSingleSubst),
|
'single': (1, parseSingleSubst),
|
||||||
'multiple': (0, parseMultiple),
|
'multiple': (2, parseMultiple),
|
||||||
'alternate': (0, parseAlternate),
|
'alternate': (3, parseAlternate),
|
||||||
'ligature': (0, parseLigature),
|
'ligature': (4, parseLigature),
|
||||||
'context': (0, parseContextSubst),
|
'context': (5, parseContextSubst),
|
||||||
'chained': (0, parseChainedSubst),
|
'chained': (6, parseChainedSubst),
|
||||||
'reversechained':(0, parseReverseChainedSubst),
|
'reversechained':(8, parseReverseChainedSubst),
|
||||||
},
|
},
|
||||||
'GPOS': {
|
'GPOS': {
|
||||||
'single': (0, parseSinglePos),
|
'single': (1, parseSinglePos),
|
||||||
'pair': (0, parsePair),
|
'pair': (2, parsePair),
|
||||||
'kernset': (0, parseKernset),
|
'kernset': (2, parseKernset),
|
||||||
'cursive': (0, parseCursive),
|
'cursive': (3, parseCursive),
|
||||||
'mark to base': (0, parseMarkToBase),
|
'mark to base': (4, parseMarkToBase),
|
||||||
'mark to ligature':(0, parseMarkToLigature),
|
'mark to ligature':(5, parseMarkToLigature),
|
||||||
'mark to mark': (0, parseMarkToMark),
|
'mark to mark': (6, parseMarkToMark),
|
||||||
'context': (0, parseContextPos),
|
'context': (7, parseContextPos),
|
||||||
'chained': (0, parseChainedPos),
|
'chained': (8, parseChainedPos),
|
||||||
},
|
},
|
||||||
}[tableTag][typ]
|
}[tableTag][typ]
|
||||||
|
|
||||||
subtables = []
|
subtables = []
|
||||||
|
|
||||||
typ = lookup.LookupType
|
|
||||||
while lines.peek():
|
while lines.peek():
|
||||||
with lines.until(('% subtable', 'subtable end')):
|
with lines.until(('% subtable', 'subtable end')):
|
||||||
while lines.peek():
|
while lines.peek():
|
||||||
if typ is 0:
|
subtable = parseLookupSubTable(lines, font, lookupMap)
|
||||||
subtable = parseLookupSubTable(lines, font, lookupMap)
|
assert lookup.LookupType == subtable.LookupType
|
||||||
lookup.LookupType = subtable.LookupType
|
|
||||||
else:
|
|
||||||
subtable = ot.lookupTypes[tableTag][lookup.LookupType]()
|
|
||||||
parseLookupSubTable(subtable, lines, font, lookupMap)
|
|
||||||
subtables.append(subtable)
|
subtables.append(subtable)
|
||||||
if lines.peeks()[0] in ('% subtable', 'subtable end'):
|
if lines.peeks()[0] in ('% subtable', 'subtable end'):
|
||||||
next(lines)
|
next(lines)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user