You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, I know I didn't really deliver on #35 (thanks @BookOwl for working on that), but now there is a cython binding to nanosvg (one of the original ideas I had). It needs a bit of cleaning, and the build process needs to be made cross platform, but I think if that happens (or more exactly if I do that), I could probably re-write the Svg Api to no longer rely on imagemagick and use a module instead. Is this seen as an improvement? Is this desired?
Well, trying to not think about my midterm later, I got it working :)
The code is here. It may break. Let me know if there are questions. Installing: run git clone --recursize https://github.com/ethanhs/pynanosvg (so that it pulls nanosvg headers). Then it should be as easy as python setup.py install.
The best way to use it is likely to use Pygame's image.frombuffer on the results of rasterize. You can get the width and height from the class methods. It is an RGBA image.
Activity
skistaddy commentedon Oct 26, 2016
A module would be much better in my opinion. 😀
BookOwl commentedon Oct 27, 2016
Yes, I think that this would definitely be an improvement other what we currently are doing.
Go for it.
Tymewalk commentedon Oct 30, 2016
@ethanhs That would be a HUGE improvement. Having a module would not only be much easier but also allow others to use SVGs without using Slither.
emmatyping commentedon Oct 30, 2016
Okay. I have a big midterm on Thursday, but Im hoping Ill have time to work on it after that.
emmatyping commentedon Nov 3, 2016
Well, trying to not think about my midterm later, I got it working :)
The code is here. It may break. Let me know if there are questions. Installing: run
git clone --recursize https://github.com/ethanhs/pynanosvg(so that it pulls nanosvg headers). Then it should be as easy aspython setup.py install.The best way to use it is likely to use Pygame's
image.frombufferon the results ofrasterize. You can get the width and height from the class methods. It is an RGBA image.BookOwl commentedon Nov 3, 2016
Great work! :D
emmatyping commentedon Nov 3, 2016
Thanks! I plan on adding more error handling and tests, but the API should be 'stable' I think. (I also plan on adding it to PyPi).