How to convert text to SVG paths?

后端 未结 6 1881
孤街浪徒
孤街浪徒 2020-11-29 17:52

I have a font in ttf file and want to generate SVG with text turned into paths. I don\'t need image (so using imagettftext or Image Magick font rendering capabilities is not

6条回答
  •  半阙折子戏
    2020-11-29 18:46

    A workaround is using inkscape (execute it via exec or so after saving the SVG document to file.svg). In inkscape 0.49+, you can simply pass --export-to-svg and --export-text-to-path, like this:

    $ inkscape file_text.svg --export-text-to-path --export-plain-svg file_shapes.svg
    

    In inkscape < 0.49, you can manually script inkscape (note that this requires an X server):

    $ inkscape --with-gui --verb EditSelectAll --verb ObjectToPath --verb FileSave \
               --verb FileQuit file.svg
    

提交回复
热议问题