orbtk
orbtk copied to clipboard
SVG Icon Widget
SVG Icons
SVG Icons can be used where possible. PNG will have to be available as a fallback. SVG has obvious benefits, but it has a LOT of features. For Icons, basic SVG support should be fine. Line works well, however I have sometimes seen compatibility issues appear with gradients and drop shadows.
It would be nice to have animated Icons, but I believe we should stay away from SVG animation. We can probably find a better solution using a Widget.
Notes Regarding the SVG Standard
The SVG standard is quite comprehensive. Implementations of the standard seems to list the features they don't support more often than the features that they do.
There is the SVG 1.1 Spec https://www.w3.org/TR/SVG11/text.html
And the SVGTiny 1.2 Spec https://www.w3.org/TR/SVGTiny12/
And then the SVG 2.0 Spec https://svgwg.org/svg2-draft/
There is a W3C taskforce studying how to better unify CSS and SVG. https://www.w3.org/Graphics/fx/wiki/Main_Page
Examples
Here is a Rust library that implements the Full Static Subset of the SVG 1.1 Standard. https://github.com/RazrFalcon/resvg
@FloVanGH metioned raqote as a solution, since OrbTk already uses it, resvg also uses it, so it seems to be the way forward.
Update: resvg moved on to use tinyskia. That is already integrated to OrbTK.
I've heard of the SVG format being used to contain character glyphs on colored vector fonts. This would be a stepping stone in that direction. My only complaint about SVG is that it's a text-based XML format inside but if there were a tokenized version that was binary, maybe a RON file derivative, it would make parsing SVG objects a one-time thing.