Script to convert multiple SVG images to a SVG font file

7.7k views Asked by At

I'm searching for a script to convert multiple SVG images (each containing one letter) to a SVG font file.

Basically the same this website does: http://keyamoon.com/icomoon/app/

But I would prefer a script (preferable Linux), so we can integrate it in our build process.

Any ideas? Or code I can start with?

Input should be a list of SVG images + a mapping file and the output should be one file containing all the SVG images as SVG font.

3

There are 3 answers

0
commadelimited On BEST ANSWER

FYI, two guys just released a project to do this very thing:

https://github.com/FontCustom/fontcustom

0
ausi On

I wrote a command line application that creates a SVG font from a set of SVG files and vice versa: https://github.com/madeyourday/SVG-Icon-Font-Generator

It's written in PHP and is currently in beta.

But it's using no mapping file, the mapping is based on the file names.

2
pd40 On

The Apache Batik project has a SVG Font converter which may be an option for you.

From their font converter example:

java -jar batik-ttf2svg.jar /usr/home/myFont.ttf -l 48 -h 57 -id MySVGFont -o mySVGFont.svg -testcard