Closed woodroof closed 3 months ago
This used to be possible, but this was changed recently (and for the better), because it made things much harder for rendering. It's on purpose that you can't create your own fill/strokes. usvg
is supposed to be a read-only representation of an SVG which can then be used to build a rendering library on top of it. But it's not supposed to be editable.
Oh, ok. Thank you for the explanation.
You're not suppose to create usvg::Tree
yourself. If you want to render some stuff - just use tiny-skia
directly. You don't need resvg
.
I'm playing with usvg::Tree binary serialization and deserialization, so I can avoid using XML. Currently I can serialize, but I have problems with deserialization — I can't create usvg::Fill and usvg::Stroke cause they don't have any public functions for creation and their fields marked as public only inside a crate. Can you provide some way for creating objects of these types from an external library?