Closed DerKarlos closed 2 years ago
raqote needs an interface to resvg: https://docs.rs/resvg-raqote/0.10.0". But the versions don't fit. I assume, resvg-raqote needs an update. In docs.rs, all sources of resvg-raqote exist (by some tricks) but I can't find a Git and no name of the creator.
When tree-d loads a texture/SVG in the GPU it could use the browser API to convert SVG to a bitmap. I will try to write some code. This seems the better way now. Do you agree?
I agree that the svg needs to be converted to a bitmap and then the rest is supported by three-d
. What the best way to convert and svg to a bitmap is, I don't know. But remember that it should be supported on both desktop and web.
Rasterizing an SVG is simple when using usvg
and tiny_skia
: https://github.com/emilk/egui/blob/master/egui_extras/src/image.rs#L144-L177
Rasterizing an SVG is simple when using
usvg
andtiny_skia
Yes, I used it. It did not build for WASM. And it would be creat, if it is (optionally) intecrated in the Assert-Load process.
If an uri ends with ".svg" the loaded file is not a textaure but a Scripted Vector Graphic(?) and needs to be converted in a texture. The crate resvg is usefull. Rendering wit tiny_skia only works for binary, for WASM raqote may do it (I will test it) Anyway, after loading the svg file, three-d should convert it to a texture before inserting it in the file pool.
Another option for WASM may be to do the SVG to bitmap rendering by a browser Javascript API.