4 ms·
Ask HN: Language with good SVG libraries?
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.
- planteen 10y agoSVG 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.
- Qwertystop 10y agoWhile 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.
- planteen 10y agoWhen 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.
- LarryMade2 10y agoYou 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.
- bbcbasic 10y agoJavaScript and d3js would suit you well. And if you hate JS just transpile from your fave language.