Converting SVG with custom fonts to PNG using ImageMagick

后端 未结 4 1851
误落风尘
误落风尘 2021-01-06 06:07

I\'m converting SVG\'s to PNG using ImageMagick and all works like a charm until I tried adding custom fonts using @font-face and then in the SVG file. In Batik this worked

4条回答
  •  梦毁少年i
    2021-01-06 06:17

    Inkscape can be run from the command line. It has a wealth of options for doing the conversion (see man inkscape) and via the --verb and --select options can even allow carrying out actions as you'd do them from inside the GUI.

    It's also fairly quick at the conversion, as halfer pointed out. However note that its renderer is designed for interactive display rather than the single-pass static display that rsvg does, so rsvg may be faster in some cases. Also, installation of Inkscape on web servers can sometimes be problematic simply due to the large number of dependencies this GUI app pulls in.

    When we added these command line options to Inkscape it was partly because rsvg lacked support for a lot of SVG features, including font faces. Since that time rsvg has improved and I think it now should support substitution of fonts via the font-face property. The most common issues are having fonts installed in places that rsvg doesn't look (maybe proprietary fonts are kept in a different path in your distro?)

    Good luck, let us know if you sort it out.

提交回复
热议问题