5 ms·
Is there a preferred cross-platform, open-source library for SVG than Cairo?
by adamredwoods 6y ago
Is there a preferred cross-platform, open-source library for SVG than Cairo?
- p4bl0 6y agoIt seems the only alternative is Skia (https://skia.org/ https://skia.org/), which is a Google project…
- dylan604 6y agogreat, so it has what 18 months before being killed off?
- Matheus28 6y agoIt's used by Chrome, Blink, and a lot of other projects, so unlikely to be killed any time soon.
- mdwrigh2 6y agoSkia has been around for 15 years (open source for 12) and is used in a number of high priority projects for Google (e.g. Android, Chrome). It's incredibly unlikely it will be killed any time soon.
- Matheus28 6y agoSide note: Skia can't render SVGs directly. You need a separate library to do the parsing and issue commands to Skia. I think they might have experimental support for simple svgs committed in the repo, though.
- badsectoracula 6y agoAFAIK one issue with Skia is that its API is not stable (and it is written in C++ which makes stability kinda hard) whereas Cairo's API has been stable for a long time.
- lxe 6y agoWhat about Skia?
- zepto 6y agoApparently hard to build.
- mmm_grayons 6y agoIt used to be really hard, though I believe there's now experimental cmake support. Vcpkg has it, so if you're using that, it's much easier.
- necubi 6y agoIt's not the most fun project to build, but not that hard following the directions here: https://skia.org/user/build https://skia.org/user/build. I've even been able to get it to build on a Pi (although that took more elbow-grease). Also, if you're using Rust, the rust-skia [0] project provides prebuilt binaries for a bunch of platforms and using it is as simple as putting it in your Cargo.toml. [0] https://github.com/rust-skia/rust-skia https://github.com/rust-skia/rust-skia
- deleted 6y ago[deleted]
- moonchild 6y agoBlend2d - https://blend2d.com/ https://blend2d.com/
- The_rationalist 6y agoBlend2d is still slower than skia. The only renderer that I know that could outperform skia is fastuidraw
- Asm2D 6y agoCan you post a link to any benchmark that would prove that?
- The_rationalist 6y agohttps://blend2d.com/performance.html https://blend2d.com/performance.html The official benchmarcks show that blend2d isn't significantly faster than QT or Cairo renderers and it is common wisdom that Skia often order of magnitudes faster than them. I talked to the blend2d author ~ a year ago and he will not publish skia benchmarck until it's new "more parallel" version of blend2d is ready which imply he is skeptic that current blend2d is competitive with Skia. Fastuidraw is the only renderer to have shown benchmarcks outperforming skia but it is mostly unmaintainef today and the benchmarks weren't representative
- Asm2D 6y agoDo you think it's right to state something because of "common wisdom"? Claims like "order of magnitudes faster" should be supported by a reference, because from my own experience making something order of magnitude faster is really difficult and sometimes impossible. This is btw why Blend2D provides a benchmarking tool, to not claim something that cannot be verified. I'm the author of Blend2D and I have never stated what you claim I did. I just gave up trying to compile SKIA. The benchmarking tool Blend2D uses is open source, maybe you can contribute SKIA backend to the tool and use it as an evidence? Otherwise all you say is just unfounded, sorry. BTW SKIA team was positively impressed by the performance of Blend2D when it came out and we are in contact. I would not be surprised if SKIA started using similar techniques like Blend2D - for example JIT compiler. They are exploring new territories like Blend2D does.
- tothrowaway 6y agoresvg - https://github.com/RazrFalcon/resvg https://github.com/RazrFalcon/resvg The developer also produced an incredibly useful SVG test suite comparing various libraries https://razrfalcon.github.io/resvg-test-suite/svg-support-table.html https://razrfalcon.github.io/resvg-test-suite/svg-support-ta...
- binarycodedhex 6y agolibrsvg ?
- ledbettj 6y agolibrsvg uses cairo under the hood to actually draw things, at least at the moment.
- binarycodedhex 6y agoArgh! Package dependency hell of the second kind: mandatory requirements. It could be A Good Thing™ parts are being rewritten in Rust, but the costs, performance, and modularity of maintaining vs. ditching cairo needs to be weighed. Having two SVG rendering engines would have advantages (choices) and disadvantages (compatibility, security, code bloat).