sile-typesetter / sile

The SILE Typesetter — Simon’s Improved Layout Engine
https://sile-typesetter.org
MIT License
1.68k stars 99 forks source link

Use lunavg to remove vendored nanosvg #1205

Open alerque opened 3 years ago

alerque commented 3 years ago

Look into this: https://github.com/iongion/lunavg

See comments in #1097 about the vendored C code we have in the repo now.

Long term a Rust library for dealing with SVG might be better, but even if we stick with nanosvg, using a Lua wrapper through a Luarocks dependency would probably be better architecture.

mgrudzinska commented 3 years ago

have you considered using ThorVG?

It's a very compact graphics lib written in C++. For now we support C++ and C APIs. We really care about the performance. We are developing the lib intensively and are very responsive to any potential issues :)

You can find more details here: https://github.com/Samsung/thorvg

alerque commented 3 years ago

No I haven't. Never even heard of it. Are there Lua bindings anywhere? It wouldn't be terribly hard to make our own but it's not my favorite chore -;) Frankly I'd be more interested in a Rust library if we do migrate to something else (since we're looking at it for other reasons already) but I'll keep an eye on this option too.

mgrudzinska commented 3 years ago

For now we don't have neither lua nor rust bindings, although we're considering the latter. We are also open for suggestions :)

Omikhleia commented 2 years ago

@mgrudzinska

have you considered using ThorVG?

From a quick test with the viewer, as well as browsing the documentation, it seems

ctrlcctrlv commented 2 years ago

why not Skia

alerque commented 2 years ago

Thanks for the research @Omikhleia. I think you're right we really want to focus on vector output here, so basically need a SVG→Postscript , not an SVG renderer.

@ctrlcctrlv My only experience with Skia is the nightmare that it is to build packages for it since it is so tightly tied in to the Chrome sources. To my knowledge there is no Lua wrapper project available, although I see there are some sort of Lua bindings upstream now, something I was not aware of. That definitely makes it something we should consider since not only is the SVG handling robust (and even because of the ubiquity in browsers, even it's mistakes are often tolerated), but it also would give us handling for several other vector formats to boot.