From 5626514ff2112997f3eb7b203bab3dfc9366271c Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Tue, 12 Sep 2017 11:53:21 -0400 Subject: [PATCH] support building varfont from designspaces without If one makes a minimal designspace (eg. with SuperPolator) for the purpose of generating a variable font from a set of UFO masters, one may have no instances defined. We need to account for the instances element not be present in the designspace, instead of failing with 'KeyError'. --- Lib/fontmake/font_project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/fontmake/font_project.py b/Lib/fontmake/font_project.py index 3e3ee365..3f654011 100644 --- a/Lib/fontmake/font_project.py +++ b/Lib/fontmake/font_project.py @@ -547,7 +547,7 @@ def _designspace_locations(self, designspace_path): maps = [] ds = varLib.designspace.load(designspace_path) - for location_list in (ds['sources'], ds['instances']): + for location_list in (ds['sources'], ds.get('instances', [])): location_map = {} for loc in location_list: abspath = os.path.normpath(os.path.join(