svg-ttf-generator
v1.0.1
Published
Converts SVG font to TTF font
Readme
svg-ttf-generator
Converts SVG fonts to TTF format. It was forked from svg2ttf.
Why?
Because the [glyph] tag is old, when we create SVG image, using Adobe Illustrator or other software, we can't get right format. So I fork svg2ttf and change the core to support [path] tag.
Install:
npm install -g svg-ttf-generatorUsage example:
svg-ttf-generator fontello.svg fontello.ttfAPI
svg-ttf-generator(svgFontString, options) -> buf
svgFontString- SVG font contentoptionscopyright- copyright string (optional)description- description string (optional)ts- Unix timestamp (in seconds) to override creation time (optional)url- manufacturer url (optional)version- font version string, can beVersion x.yorx.y.
buf- internal byte buffer object, similar to DataView. It'sbufferproperty isUin8ArrayorArraywith ttf content.
Example:
var fs = require('fs');
var svg2ttf = require('svg-ttf-generator');
var ttf = svg2ttf(fs.readFileSync('myfont.svg', 'utf8'), {});
fs.writeFileSync('myfont.ttf', new Buffer(ttf.buffer));