-
Notifications
You must be signed in to change notification settings - Fork 227
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
Failed to rendering a text in nested SVG #740
Comments
Yes, we're loading fonts only when the main SVG has text nodes. We do not check referenced SVGs. For now, simply add a single empty |
Amazing! Thank you for very fast reply! |
Didn't I fix this in #675? Apparently I didn't... |
Oh... It's because That's gonna be tricky to change though if we want to do it inside the resvg CLI... Maybe it's best to just always initialize the fontdb? |
That's pretty slow. Even on a macbook with a hot cache it's like 10-20ms. The issue here is that before, text flattening was done after parsing, not during. So before we were checking for This is partially related to #710 , as we have to add a callback to text flattening. I haven't thought about it much yet. The only "solution" so far is to have some public, intermediate tree representation. One between |
That will be a lot of trees then. :p But I've also had thoughts about whether there should be some additional intermediate representation... |
While intermediate representations do reduce performance a bit, they do simplify the code and logic quite a lot. My goal is to keep |
I wrote are two SVGs and I nested those and I got a blank image unexpectedly.
Is this a bug...? (Sorry. I can't classify that problem as bug, unimplemented feature, undefined behaviour or something else, because I'm not an expert of SVG specification.)
Version: 0.41.0
OS: Windows 11 23H2 22631.3447 (x86_64) and Arch Linux.
I got a same results in
--use-fonts-dir
option.Text containing SVG (
child.svg
)Works expectedly if this file only.
This file just needs to contain a text element.
But I wrote some elements and attributes for visiblity.
Rendered Image (
child.svg
):Parent SVG (
parent.svg
)Rendered Image (
parent.svg
):Actually behaviour (
parent.svg
)and I got warning:
Expected behaviour (
parent.svg
)Completly same as
child.svg
in this case.The text was updated successfully, but these errors were encountered: