Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Language with good SVG libraries?
5 points by Qwertystop on Dec 5, 2016 | hide | past | favorite | 5 comments
I've had an idea recently that involves automated programmatic creation of simple geometric vector graphics. Mostly repeated composition of lines, arcs, and circles, with varying endpoint shapes. Learning a new programming language is not an obstacle - it'd be good to have the extra motivation, actually.

Can anyone recommend a language for which there are good libraries for this purpose (and such a library, of course)? A minor plus would be if it also has good libraries for making a web-app, but that's not high-priority since the actual image-generation can be separated from the web-app that delivers results without needing any conceptual changes, as long as I go with a thin client in that case.




You might look into TCPDF library for PHP, it is for generating PDFs, does a lot of great graphics stuff. Add inith FPDI and you can also import PDF files as page templates. You can set whatever page sizes, etc. And being PHP based it is very web capable.


SVG is just XML, so any language that can write XML can handle SVG. There are plenty of tools to rasterize the SVG to a PNG. I don't think the choice of language matters very much.


While that's true, there's a bit of a divide between "can write arbitrary XML" and having a proper scene-graph to e.g. place shapes relative to each other, or apply transformations to groups. In the same way, "has string processing" is not "has a framework for static web pages", for all that it's possible to put together arbitrary HTML from that point.


When you look at the SVG spec, it is quite simple, and not very different from what you would have to do in graphics APIs like OpenVG anyway for the operations you have described.


JavaScript and d3js would suit you well. And if you hate JS just transpile from your fave language.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: