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

With ufo2ft==2.29.0 I can't access ttf.reader on an object returned by compileTTF #3940

Closed
felipesanches opened this issue Nov 2, 2022 · 3 comments · Fixed by #4126
Closed
Assignees
Milestone

Comments

@felipesanches
Copy link
Collaborator

Screenshot from 2022-11-02 22-01-09

felipesanches added a commit to felipesanches/fontbakery that referenced this issue Nov 2, 2022
felipesanches added a commit that referenced this issue Nov 2, 2022
@felipesanches felipesanches added this to the 0.8.11 milestone Nov 2, 2022
@anthrotype
Copy link
Member

That's a feature, not a bug ;)

In the ufo2ft postProcessor were previously always compiling the ttfont to an in-memory bytesIO buffer and reloading it off that, but that was only necessary when renaming glyphs so we don't do that any more unconditionally. The TTFont instance you get from ufo2ft is created from scratch not read from disk so you should not expect it to have a reader attribute, that's only for TTFonts read from a file.

@anthrotype
Copy link
Member

If you require that your test font has a reader, you need to do what we were doing in ufo2ft, that is save it to a temporary BytesIO and open a new TTFont from that, which will then be as if it were read from a file (only that the file is an in memory stream)

@felipesanches
Copy link
Collaborator Author

Thanks! I will try that.

@felipesanches felipesanches self-assigned this Nov 3, 2022
@felipesanches felipesanches modified the milestones: 0.8.11, 0.8.12 Mar 3, 2023
danc86 added a commit to danc86/fontbakery that referenced this issue Apr 25, 2023
Starting from ufo2ft 2.29.0, the TTFont instance produced by ufo2ft may
not have a .reader attribute.

Fixes fonttools#3940.
felipesanches pushed a commit that referenced this issue Apr 25, 2023
Starting from ufo2ft 2.29.0, the TTFont instance produced by ufo2ft may
not have a .reader attribute.

Fixes #3940.
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 a pull request may close this issue.

2 participants