0.0.1 • Published 8 years ago

svg2sfd v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

svg2sfd

A command line tool for managing font data on a single svg file.

Requirements

  1. FontForge
  2. Inkscape

How to install

$ npm install -g svg2sfd

How to use

  1. Copy the example
  2. Edit glyphs with Inkscape
  3. Run $ svg2sfd /path/to/svg/file.svg and you will get /path/to/svg/file.sfd

Requirements for the structure of the SVG tree

  1. Each glyph should be a single <path/>
  2. Each glyph should be a child of the root <svg> element
  3. Each glyph has a character code in the id attribute. It is specified as a 4-digit base-16 number. For example, a glyph represents "A" has "0041" in the id attribute.
  4. Use Inkscape grid feature to align glyphs. svg2sfd calculates offsets automatically using grid.
  5. Set the attributes below to the root <svg> element

    1. sfdSplineFontDB="3.0"
    2. sfdEncoding="ISO8859-1"
    3. sfdDescent="256"

    svg2sfd adds the other "sfd-" prefixed attributes before "BeginChars" line of the .sfd file. For example, sfdWeight="Medium" results in Weight: Medium.

0.0.1

8 years ago