Added streaming support to Face #112
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Face class now provides a constructor which accepts Stream as a parameter. The stream must support reading and seeking.
Callback functions for reading/seeking and closing the external stream are provided by the Face class (StreamIOFunc, StreamCloseFunc). I changed the delegates to accept IntPtr as an opaque pointer to the stream FT_Stream structure, instead of NativeReference.
The stream is open during the entire duration of Face existence. The user can choose whether it should be disposed together with the Face or not (using the takeStreamOwnership argument when creating Face).
The goal here is 1) to allow the user to access fonts via some custom virtual file system 2) to avoid the necessity of loading entire font into memory