Skip to content

Commit

Permalink
support building varfont from designspaces without <instances>
Browse files Browse the repository at this point in the history
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'.
  • Loading branch information
anthrotype committed Sep 12, 2017
1 parent 2a48da4 commit 5626514
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/fontmake/font_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 5626514

Please sign in to comment.