-
Notifications
You must be signed in to change notification settings - Fork 29
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
Update to bevy 0.14, usvg 0.42, and several bug fixes #41
Conversation
Text translation seems to be broken
So I finally figured out why the transforms were messing with the rendering. Although, it's fixed every problem I've had with my SVG's it somehow totally butchers the twinkle example. Since text isn't working anyway, I might try to backport the required changes to the older version of usvg and see how that turns out. |
well i was able to backport the fixes to get the same results and in the process I realized why text isn't working. So the only things left for this specific PR would be:
Edit: I've figured out how to fix twinkle and subsequently strokes not being scaled properly in certain scenarios. The PathEvent needs to be transformed with a normalized transform without any scale and the scale applied in the vertex buffer (only for stroke), paths are just transformed PathEvents. |
Ok I think this is mostly at least feature parity or even improving since it's last release I'm going to do some more experimenting this weekend and see if I can find a way to properly reconstruct the twinkle SVG with the data that's being parsed before I take it out of draft, but anyone is welcome to review/test it with other svgs as is. Edit: Might just be an edge case svg as resaving it in inkscape makes it renderable in resvg Edit 2: Ah, its not up to spec |
I had confused missing font text rendering issues as the wrongful placement of text.
Ok... wow. Thanks for the amazing work you are putting into this. 🙏 |
No worries, take your time. I'm just happy to have finally chased down most of the problems I've had trying to get non-rasterized SVG support working in Bevy :) |
Looking good to me! |
I'm dropping this here in case this helps anyone. It still disappointingly fails to render specific svg's with compounded transforms and text doesn't appear to be working.updates bevy to 0.14
updates usvg to 0.42
fixing several issues like bad transforms
adds "basic" gradient support for now instead of dropping the color all together (is just an average of the first and last stop)
Fix panic in svgs that use path strings and end with a move operation
Knight now renders correctly fixing #37

Old Details
Text stopped rendering with usvg version >=0.38 (not rendering text for resvg cli)Compounded transforms still broken (working for resvg cli)Renders twinkle (if you fix it by removing the illegal group nodes inside text/tspan or resave in inkscape)

Bevy Logo

Queen of hearts

Averaging of gradients for fallback (instead of showing nothing)
