Skip to content

Commit

Permalink
Opportunistically use iondrive if available
Browse files Browse the repository at this point in the history
  • Loading branch information
madig committed Sep 27, 2021
1 parent 5f98037 commit e74fc55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Lib/fontmake/font_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import ufo2ft
import ufo2ft.errors
import ufoLib2
import ufoLib2.objects
from fontTools import designspaceLib
from fontTools.misc.loggingTools import Timer, configLogger
from fontTools.misc.plistlib import load as readPlist
Expand Down Expand Up @@ -118,6 +119,12 @@ def __init__(self, timing=False, verbose="INFO", validate_ufo=False):

def open_ufo(self, path):
try:
try:
import iondrive

return iondrive.load(ufoLib2.objects, path)
except ImportError:
pass
return ufoLib2.Font.open(path, validate=self.validate_ufo)
except Exception as e:
raise FontmakeError("Reading UFO source failed", path) from e
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
# "lxml>=4.2.4",
],
"mutatormath": ["MutatorMath>=2.1.2"],
"iondrive": ["iondrive>=1.0"],
}
# use a special 'all' key as shorthand to includes all the extra dependencies
extras_require["all"] = sum(extras_require.values(), [])
Expand Down

0 comments on commit e74fc55

Please sign in to comment.