From 4b38a20cee1b79dda6944f4c7487bd2d13108df2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 27 Dec 2016 15:19:22 -0500 Subject: [PATCH] [mtiLib] Set lookup type even if lookup is empty For real this time. --- Lib/fontTools/mtiLib/__init__.py | 47 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/Lib/fontTools/mtiLib/__init__.py b/Lib/fontTools/mtiLib/__init__.py index a3dbc2682..644d8d2d3 100644 --- a/Lib/fontTools/mtiLib/__init__.py +++ b/Lib/fontTools/mtiLib/__init__.py @@ -817,31 +817,30 @@ def parseLookup(lines, tableTag, font, lookupMap=None): lookup.LookupFlag,filterset = parseLookupFlags(lines) if filterset is not None: lookup.MarkFilteringSet = filterset + lookup.LookupType, parseLookupSubTable = { + 'GSUB': { + 'single': (1, parseSingleSubst), + 'multiple': (2, parseMultiple), + 'alternate': (3, parseAlternate), + 'ligature': (4, parseLigature), + 'context': (5, parseContextSubst), + 'chained': (6, parseChainedSubst), + 'reversechained':(8, parseReverseChainedSubst), + }, + 'GPOS': { + 'single': (1, parseSinglePos), + 'pair': (2, parsePair), + 'kernset': (2, parseKernset), + 'cursive': (3, parseCursive), + 'mark to base': (4, parseMarkToBase), + 'mark to ligature':(5, parseMarkToLigature), + 'mark to mark': (6, parseMarkToMark), + 'context': (7, parseContextPos), + 'chained': (8, parseChainedPos), + }, + }[tableTag][typ] + with lines.until('lookup end'): - - lookup.LookupType, parseLookupSubTable = { - 'GSUB': { - 'single': (1, parseSingleSubst), - 'multiple': (2, parseMultiple), - 'alternate': (3, parseAlternate), - 'ligature': (4, parseLigature), - 'context': (5, parseContextSubst), - 'chained': (6, parseChainedSubst), - 'reversechained':(8, parseReverseChainedSubst), - }, - 'GPOS': { - 'single': (1, parseSinglePos), - 'pair': (2, parsePair), - 'kernset': (2, parseKernset), - 'cursive': (3, parseCursive), - 'mark to base': (4, parseMarkToBase), - 'mark to ligature':(5, parseMarkToLigature), - 'mark to mark': (6, parseMarkToMark), - 'context': (7, parseContextPos), - 'chained': (8, parseChainedPos), - }, - }[tableTag][typ] - subtables = [] while lines.peek():