Home

Awesome

svgs2ttf

Description

A quick & dirty FontForge + Python script to generate fonts from a directory of SVG files (or other outline formats importable by FontForge) and some JSON metadata.

Not to be confused with svg2ttf. Users with more sophisticated needs probably want Font Custom, grunt-webfont, or IcoMoon.

Dependencies

Usage

$ svgs2ttf metadata.json

Example metadata.json:

{ "props":
  { "ascent": 800
  , "descent": 200
  , "em": 1000
  , "family": "Example"
  }
, "input": "src"
, "output": [ "example.ttf" ]
, "glyphs":
  { "0x41": { "src": "a.svg" }
  , "0x42": { "src": "b.svg" }
  , "67": "c.svg"
  }
}

See examples/example.json for an example that specifies more options. Some customizations might be best done by editing the script. (See the FontForge python reference.)

Input file restrictions