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

Move fontfeature import statement #61

Merged
merged 2 commits into from
Dec 1, 2023

Conversation

NightFurySL2001
Copy link
Contributor

Fix #56 ?

@typemytype
Copy link
Member

this is not a conditional import, test if the package is available and decide

but the import issues with fontFeatures has been resolved upstream (no need for numpy anymore)

@typemytype
Copy link
Member

should be something like:

try:
    from fontFeatures.ttLib import unparse
    _haveFontFeatures = True
except ImportError:
    _haveFontFeatures = False
    
def extractOpenTypeFeatures(source):
    if _haveFontFeatures:
        return unparse(source).asFea()
    return ""

@typemytype changed this to do the try/except only if features are asked for, no need to do it if they aren't
@benkiel
Copy link
Member

benkiel commented Dec 1, 2023

@typemytype if my change to your sample looks good to you, I'll merge and push an update

@typemytype typemytype merged commit b330ddf into robotools:master Dec 1, 2023
8 checks passed
@typemytype
Copy link
Member

thanks Ben!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request to move import fontFeatures into extractOpenTypeFeatures with conditional import
3 participants