Font converter from ttf, otf to svg, woff, woff2, eot formats
npm install converter-webfont -g
npm install git://github.com/kto32/converter-webfont -g
cwebfont ./pathIn ./pathTo format
npm install converter-webfont
npm install git://github.com/kto32/converter-webfont
var convertFont = require('converter-webfont');
//do something
try {
convertFont('./pathIn', './pathTo', 'svg,eot,ttf,woff');
} catch (err) {
console.log(err);
}
//do something
or
var convertFont = require('converter-webfont');
//do something
convertFont('./pathIn', './pathTo', 'svg,eot,ttf,woff');
//do something
Type: String
Required: true
The path to the folder with fonts in the ttf, otf format. Files of other formats in the folder are ignored.
Type: String
The path to save the result.
If you don't specify the path to the folder for saving the result, but specify the format or leave the field empty, then the result will be saved in the same folder
Type: String
Default value: svg,ttf,eot,woff
Specify formats separated by commas, possible formats: svg,ttf,eot,woff,woff2
.
When using woff2, the script will work out a little longer due to compression.
(v.0.0.0)
(v.1.0.0)