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

Certain fonts crash get_features() #50

Closed
seproDev opened this issue Jan 26, 2023 · 4 comments · Fixed by #53
Closed

Certain fonts crash get_features() #50

seproDev opened this issue Jan 26, 2023 · 4 comments · Fixed by #53
Assignees
Labels
bug Something isn't working

Comments

@seproDev
Copy link
Contributor

seproDev commented Jan 26, 2023

Python version
3.10.9

Package version
0.14.4

Current behavior (bug description)

Calling get_features() on this font crashes fontbro.
Stacktrace:

Traceback (most recent call last):
  File "C:\Users\User\Desktop\fonts\main.py", line 24, in <module>
    font.get_features()
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontbro\font.py", line 319, in get_features
    features_tags = self.get_features_tags()
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontbro\font.py", line 338, in get_features_tags
    feature_record = table.FeatureList.FeatureRecord or []
AttributeError: 'NoneType' object has no attribute 'FeatureRecord'

Looks like FeatureList can be None. This only affects the GSUB and not the GPOS table.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@seproDev seproDev added the bug Something isn't working label Jan 26, 2023
@fabiocaccamo
Copy link
Owner

Could you provide also a font to use for adding a test case?

@seproDev
Copy link
Contributor Author

The file I linked is fine to use as a test case, as it is an older version of League Gothic which is licensed under OFL.

@fabiocaccamo
Copy link
Owner

Sorry, I totally missed the link in the first message! Thank you

@fabiocaccamo fabiocaccamo moved this to Todo in Open Source Jan 26, 2023
@seproDev seproDev mentioned this issue Jan 28, 2023
3 tasks
fabiocaccamo pushed a commit that referenced this issue Jan 29, 2023
* Fix crash on Windows

Without deleting the object the file stays locked preventing the removal of the temporary folder

* Correctly center text in get_image()

* Fix AttributeError in get_features()

Closes #50

* Set unicode_name default to None

Closes #51

* Check if chr() conversion is in acceptable range

Closes #52

* Add unit tests for issue 50, 51, 52

* Expose all TTFont arguments

* Fix typos in pull request template

* Fix get_fingerprint()
@github-project-automation github-project-automation bot moved this from Todo to Done in Open Source Jan 29, 2023
@fabiocaccamo
Copy link
Owner

Fixed in 0.14.5 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants