tiby312 / poloto-project

MIT License
158 stars 10 forks source link

add optional resvg support? #150

Closed tiby312 closed 2 years ago

tiby312 commented 2 years ago

Updated poloto svg output to be more compliant to make resvg happy. However resvg doesnt support dominant-baseline which poloto uses to align labels.

https://github.com/RazrFalcon/resvg/issues/119

Added an example that uses inkscape.

https://github.com/tiby312/poloto/blob/master/convert_to_png_test.sh

Icelk commented 2 years ago

Is this blocked on the linked issue? Could there be a optional cargo feature in the future which enables the option to export to PNG? Or is this out of your realm, so suggesting in the docs to use the resvg library as a dependency?

tiby312 commented 2 years ago

With latest poloto, if you do cargo install resvg you can get it to generate out png that looks almost right except for the alignment issues because of the above issue.

command: resvg target/assets/collatz.svg target/assets/collatz.png

optional cargo feature to provide resvg support sounds like a great idea. If resvg fixes that issue will add. Untill then I think having people use the an external command is good enough. The inkscape command produces a good png.

inkscape target/assets/collatz.svg -e target/assets/collatz.png