Skip to content

Commit

Permalink
Also open JSON UFOs
Browse files Browse the repository at this point in the history
  • Loading branch information
anthrotype committed Jul 27, 2023
1 parent df71fa3 commit 2d5b2eb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Lib/fontmake/font_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ def __init__(

def open_ufo(self, path):
try:
path = Path(path)
if path.suffix == ".json":
with open(path, "rb") as f:
# pylint: disable=no-member
return ufoLib2.Font.json_load(f) # type: ignore
return ufoLib2.Font.open(path, validate=self.validate_ufo)
except Exception as e:
raise FontmakeError("Reading UFO source failed", path) from e
Expand Down

0 comments on commit 2d5b2eb

Please sign in to comment.