Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Collaborator
Author
|
Ideally all the drawbacks mentions above could be fixed by using a dirty hack and heavily manipulate the file before feeding to |
|
looking forward to this pr |
539accc to
6d3968a
Compare
15dd771 to
34c1451
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fixes #101 #115
The idea is to add a new
ResvgBuildertype, which does all the pre-resvg resolving stuff. Behind the scene it uses the xml reader whichresvguses and find all text nodes, try to gather font information of them (by using a naive ancestor-inheritance logic) and output all fonts needed via a new apitexts_to_resolve().Users could use this new api to get whatever font they have which satisfies the given font key, and call
resolve_font(buffer)to feed the font buffer to the builder.Later on, builder will uses these fonts to construct the
font_db::Databaseinstance so that the texts will not be eliminated by resvg/usvg.Some drawbacks:
usvgis also not perfect, the impl in this PR is worse.monospaceand you want to render it by providing aubuntu monofont, it would just fail.