Converting SVG with custom fonts to PNG using ImageMagick

后端 未结 4 1801
误落风尘
误落风尘 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条回答
  •  囚心锁ツ
    2021-01-06 06:19

    I had this answer after asking for rendering html to an image but it works also for SVG: https://stackoverflow.com/a/56194265/118125

    "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --headless --screenshot --window-size=256,256 --default-background-color=0 image.svg
    

    It generates a screenshot.png file according to what Google Chrome would render.

提交回复
热议问题