Generates webfonts from individual svg icons with persistent config and mapping previews
Usage: icon.font [options]
Options:
-h, --help output usage information
-V, --version output the version number
-s --src [path] Path of dir containing SVG icon files [default: ./src]
-d --dest [path] Path of dir that the generated font files should be written to [default: ./dest]
-f --fontName [name] Name to assign to the generated icon font [default: iconfont]
-c --configFile [path] Path of the file containing the icon config [default: ./src/_icon-config.json]
-t --type [path] Font file types to generate (specifiy multiple times for multiple types) [default: woff2,woff,ttf,eot,svg]
-S --silent Normalize icons by scaling them to the height of the highest icon [default: false]
--no-css Avoid generating a css file [default: true]
--no-html Avoid generating an html preview [default: true]
--no-image Avoid generating an image preview [default: true]
--no-saveConfig Avoid saving the generated config file to disk [default: true]
--no-fixedHeight Normalize icons by scaling them to the height of the highest icon [default: true]
require('icon.font')({ // Default options
fontName: 'iconfont',
src: './src',
dest: './dest',
configFile: './src/_icon-config.json',
saveConfig: true,
image: true,
html: true,
htmlTemplate: '<module>/templates/html.hbs',
outputHtml: true,
css: true,
cssTemplate: '<module>/templates/css.hbs',
outputCss: true,
fixedWidth: true,
normalize: true,
silent: true,
types: ['woff2', 'woff', 'ttf', 'eot', 'svg'],
templateOptions: {
classPrefix: '_icon-',
baseSelector: '._icon',
baseClassname: '_icon',
},
codepointRanges: [
[97,122], // a-z
[65,90], // A-Z
[48,57], // 0-9
[0xe001, Infinity]
]
}).then(function(){
// Finished
})