iconfontifi
v1.0.1
Published
Generate webfonts from SVG icons.
Downloads
3
Readme
IconFontifi
Generate webfonts from SVG icons.
- Supported font formats: WOFF, EOT, TTF and SVG.
Install
yarn add iconfontifi --dev
Usage
How as Module
// CommonJS import
const iconfontifi = require('iconfontifi').default;
// or ES6 import
import iconfontifi from 'iconfontifi';
iconfontifi({
files: [
'src/dropdown.svg',
'src/close.svg',
],
dist: 'dist/',
}, function(error) {
if (error) {
console.log('Fail!', error);
} else {
console.log('Done!');
}
})
How as CLI
Usage
$ iconfontifi [ svg-icons-glob ] -o [ output-dir ] [ options ]
Options:
-o, --out Output icon font set files to <out> directory
-n, --name Name to use for generated fonts and files (Default: icons)
-f, --fontspath Relative path to fonts directory to use in output files (Default: ./)
-c, --css Generate CSS file if true (Default: true)
--csspath CSS output path (Defaults to <out>/<name>.css)
--cssfontsurl CSS fonts directory url (Defaults to relative path)
--csstp CSS handlebars template path (Optional)
--html Generate HTML preview file if true (Default: true)
--htmlpath HTML output path (Defaults to <out>/<name>.html)
--htmltp HTML handlebars template path (Optional)
--types Font types - (Defaults to 'svg, ttf, woff, eot')
-p, --prefix CSS classname prefix for icons (Default: icon)
-t, --tag CSS base tag for icons (Default: i)
--selector Use a selector instead of 'tag + prefix' (Default: null)
--normalize Normalize icons sizes (Default: false)
--round Setup SVG rounding (Default: 10e12)
--descent Offset applied to the baseline (Default: 0)
--mono Make font monospace (Default: false)
--height Fixed font height value
--center Center font horizontally
Example:
iconfontifi src/*.svg -o icon-dist