문제

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?

도움이 되었습니까?

해결책

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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top