Question

In PHP, it's quite easy to use GD to draw text onto a raster canvas in a certain font (according to a TTF file held on the server), and output it as a PNG or JPEG.

I want to do roughly the same thing, but to draw the text as a vector outline and output it as an SVG.

(I do not want to embed the font itself in the resulting SVG, as the font is not licensed for that.)

Is there any PHP library that provides this sort of functionality?

Was it helpful?

Solution

It's possible to script inkscape to do this.

The following command opens "example.svg" and selects all shapes in the file and converts them to paths, and then saves and closes the file.

inkscape --verb EditSelectAll --verb ObjectToPath --verb FileSave --verb FileClose example.svg

OTHER TIPS

I was able to find CleverSVG trough searching, however I did not try this myself, and I am unsure if it will be able to draw text without forwarding the font.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top