Open xNWP opened 2 weeks ago
that allow(unused_mut) caught my eye but otherwise lgtm
edit: i should really read commit messages first, could you put in a comment explaining it?
commented!
i think for demonstration purposes (and to make testing easier in the future), it'd be a good idea to add an example that shows text in svgs in action
Would this text rendering work on web?
I was wondering the same thing shortly after making the PR 😅, I'm not great at web dev stuff but I'll take a look at it now and test some things.
i think for demonstration purposes (and to make testing easier in the future), it'd be a good idea to add an example that shows text in svgs in action
after checking the web stuff I'll also look at how y'all test/write example code and see what I can do 😊
Would this text rendering work on web?
Short answer, no.
Long answer is that the main workhorse of this PR is the load_system_fonts
function on the Font Database type that resvg
re-exports from the fontdb
crate (https://github.com/RazrFalcon/fontdb/blob/fd24f8c9d7b57f30a6f6ba560c697a7854c94858/src/lib.rs#L352). This function is just a conditional compilation switch based on the target os which simply does nothing for wasm. I looked into how support could be added to this crate, however it looks like the way to do it would be the Local Font Access API which has little to no browser support (only experimental Chrome + Edge support) https://developer.mozilla.org/en-US/docs/Web/API/Local_Font_Access_API
Thanks for testing web. Please document your findings, i.e. document that the svg_text
won't work on web, and why (linking to relevant issues, if any).
We should also figure out a solution to the duplicated dependencies.
Added
svg_text
feature flag.Changed
0.37
to0.42
.