Avoid "reloading" TTFonts in PostProcessor.__init__
See original GitHub issueGoing from https://github.com/fonttools/fonttools/issues/1095, quite some time is spent serializing/deserializing fonts somewhere inbetween compiling the final binary. This slows down the entire process. PostProcessor.__init__
seems to “reload” every font, maybe to clean up loose data? I think it should maybe just work with what it’s given?
Issue Analytics
- State:
- Created 3 years ago
- Comments:20 (3 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The count values are always ignored when compiling the font.
Nope. We don’t even pretend.
Or replace them with properties that warn when accessed; set a deadline for removing them, and advise code to switch. The replacement code can even be offered in the warning.
So, a lot of this would be a non-issue if we were dealing with immutable data types, such that any modification would involve copy-on-write duplication… Many functional languages work that way. In Python, I’m sure there’s some dark black magic with metaclasses to get some of that, but there will be dragons. Also, there’s no way to get compile-time errors for violations with Python.
Anyway, attrs2 on this: https://www.attrs.org/en/stable/examples.html#immutability