fix issues #608 / #405 (too many temporary files) by avoiding to call Font.createFont with inputstream #612
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.
Hi @danfickle , I was finally able to understand the issue described in #608, #405 .
This is triggered when using the SVG backend and using custom fonts.
In my case, the sample html is:
Then by simply iterating:
You can see the temporary directory slowly fill with a new temporary file during each iteration.
This PR try to ensure that at most only one temporary file is created for a given font (by hashing the byte array), instead of one for each iteration.
Putting as a draft, as I'm not sure it's the best fix.