From 80535c224ee4bcbee23a9bf95bff2c27404b88c4 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 8 Jan 2017 23:44:10 -0800 Subject: [PATCH] Fix XML->binary when LookupOrder is NOT specified Fix for 495c6831e19ff9992fb801d2930e79c7d13736ae; bringing the intended behavior documented in that commit. --- Lib/fontTools/ttLib/tables/otBase.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/fontTools/ttLib/tables/otBase.py b/Lib/fontTools/ttLib/tables/otBase.py index f754e355c..ed0c93534 100644 --- a/Lib/fontTools/ttLib/tables/otBase.py +++ b/Lib/fontTools/ttLib/tables/otBase.py @@ -679,7 +679,9 @@ class BaseTable(object): # We make sure that subtables have the same lookup type, # and that the type is the same as the one set on the # Lookup object, if any is set. - ref = writer.writeCountReference(table, conv.name, conv.staticSize, table.get(conv.name)) + if conv.name not in table: + table[conv.name] = None + ref = writer.writeCountReference(table, conv.name, conv.staticSize, table[conv.name]) writer['LookupType'] = ref else: if conv.aux and not eval(conv.aux, None, table):