Skip to content

Commit

Permalink
Changes based on feedback
Browse files Browse the repository at this point in the history
@typemytype changed this to do the try/except only if features are asked for, no need to do it if they aren't
  • Loading branch information
benkiel committed Dec 1, 2023
1 parent dd02bd7 commit 810278b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Lib/extractor/formats/opentype.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,12 @@ def _extractOpenTypeKerningFromKern(source):


def extractOpenTypeFeatures(source):
from fontFeatures.ttLib import unparse
return unparse(source).asFea()


try:
from fontFeatures.ttLib import unparse
_haveFontFeatures = True
except ImportError:
_haveFontFeatures = False

if _haveFontFeatures:
return unparse(source).asFea()
return ""

0 comments on commit 810278b

Please sign in to comment.