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
SVG support? #21
Comments
To my knowledge Skia does not support SVG loading. If and when that is added to the native library we will surface that API to C#. |
I only read the wikipedia article where it says
But on skia.org I also only found the experimental SkSVG canvas, which appears to be a back-end (?) component. Personally I'd only be interested in the front-end anyway, as that appears to be the component that reads SVG. But I take it that the SVG front-end won't be a part of SkiaSharp? |
In listing front-ends, that wikipedia article is citing an inaccurate third-party post from 2011. Skia has both a SVG parser (in include/svg/parser) and backend (in include/svg); SkSVGCanvas is part of the backend. As far as I know only the backend is currently maintained. |
In that case, I assume it is safe to say that SkiaSharp probably won't have built-in SVG support for the foreseeable future. Be that as it may, thank you both for taking the time to answer my questions! |
Loading SVGs is a separate task from SkiaSharp, for far too many reasons. The best course of action to having a cross-platform SVG loader is probably to look at the Chrome source code and write an importer based on that, leaving behind the DOM loading, hooks and dependencies on the larger parts of the browser like CSS and animations. Then we can use the test suite built by the librsvg team (librsvg would be ideal: it is a general purpose SVG loader where you can "hook" renderes to, except the license is not iOS friendly). I will be closing this issue, since this is not something we will treat as a bug in SkiaSharp, it is something to be prototyped elsewhere and then, if successful, we can bring here. |
If SkyaSharp doesn't support SVG is useless at the moment. Not supporting SVG for a vector library is like not supporting PNG for a bitmap library. I use SVG assets in my Xamarin apps thanks to the NGraphics library, and I have many advantages:
This is why I really hope that Xamarin goes the way of NGraphics and add support for SVG assets to SkyaSharp. PLEASE. Some of my SVG assets (I made them in Inkscape): You can download the original svg file from my google drive (click on the download button): Feel free to use them! For an easier debug, here it is a splitted version of the two main buttons svg files, you can download the zip from here: |
fix: Restore disabled CPU shaders
Are you working on or planning to support SVG?
Being able to load a SVG document and then rasterize it to export as e.g. PNG would be immensely valuable.
The text was updated successfully, but these errors were encountered: