Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opportunistically use iondrive if available #802

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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