-
Notifications
You must be signed in to change notification settings - Fork 475
[varLib] make build
also accept DesignSpaceDocument objects
#1425
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
Conversation
and use it in varLib to copy master font
…per func in the other tests
and remove BaseDocReader.getSourcePaths as it was broken anyway (it was assuming 'sources' attribute of DesignSpaceDocument object was a dict, whereas it is now a list of SourceDescriptor objects
Can we use Python 3.x features yet? The whole path handling stuff makes my head hurt. I'd like to have all paths be I'm not super familiar with all the use-cases for designspace objects, but what about making Let me think about what that would mean for client code.
Maybe I'm forgetting something, but path modification would mean simply overwriting the Edit: this might be something for another PR really... |
Aside from this, the changes look mostly fine to me. One thing that has me scratching my head is the |
instead of importing from TTX, and set lazy=True so we exercise the special SFNTReader.__deepcopy__
on py27, calling deepcopy on a file object doesn't raise TypeError, but leaves the duplicated file object in an inconsistent state: https://travis-ci.org/fonttools/fonttools/jobs/474811063#L714 any operations on it will fail with 'ValueError: I/O operation on uninitialized object'. Thus, for semplicity for now we always do a manual copy the file contents into an in-memory BytesIO stream, rather than attempting to call deepcopy first.
what you suggest make sense, and i've also always been confused by this duality of path/filename attributes in designspace document. However, I don't want to break existing code for the sake of it. For now, let's keep both path and filename attributes as posix path strings, mutable, and nullable (with all the problems that this implies), and deal with them later in separate PRs. About the I changed the test to load compiled binary test fonts instead of importing them as ttx to address your concern, and it actually caught a bug in that custom deepcopy implementation for SFNTReader. |
…e getSourcePath simpler is better. Also, refactored updatePaths and added more tests to it.
with source descriptors containing pre-loaded TTFont instances
Continuation of #1416