svg2ttf-nfd
v1.0.0
Published
Converts SVG font to TTF font
Readme
svg2ttf
Converts SVG fonts to TTF format. It was initially written for Fontello, but you can find it useful for your projects.
For developpers:
Internal API is similar to FontForge's one. Since primary goal is generating iconic fonts, sources can lack some spesific TTF/OTF features, like kerning and so on. Anyway, current code is a good base for development, because it will save you tons of hours to implement correct writing & optimizing TTF tables.
Using from CLI
Install:
npm install -g svg2ttfUsage example:
svg2ttf fontello.svg fontello.ttfAPI
svg2ttf(svgFontString, options) -> buf
svgFontString- SVG font contentoptionscopyright- copyright string (optional)ts- Unix timestamp (in seconds) to override creation time (optional)
buf- internal byte buffer object, similar to DataView. It'sbufferproperty isUin8ArrayorArraywith ttf content.
Example:
var fs = require('fs');
var svg2ttf = require('svg2ttf');
var ttf = svg2ttf(fs.readFileSync('myfont.svg'), {});
fs.writeFileSync('myfont.ttf', new Buffer(ttf.buffer));Authors
License
MIT.
