svgicons2svgfont

Read a set of SVG icons and ouput a SVG font

npm install svgicons2svgfont
94 downloads in the last day
489 downloads in the last week
2 853 downloads in the last month

svgicons2svgfont

svgicons2svgfont is a simple tool to merge multiple icons to an SVG font.

NPM version Build status Dependency Status devDependency Status Coverage Status Code Climate

'rect', 'line', 'circle', 'ellipsis', 'polyline' and 'polygon' shapes will be converted to pathes. Multiple pathes will be merged.

Transform attributes support is currenly experimental, report issues if any.

Usage

NodeJS module:

var svgicons2svgfont = require('svgicons2svgfont')
  , fs = require('fs');
  , fontStream = svgicons2svgfont([
    'icons/directory/icon1.svg',
    'icons/directory/icon2.svg'
  ], options);

// Saving in a file
fontStream.pipe(fs.createWriteStream('font/destination/file.svg'))
  .on('finish',function() {
    console.log('Font written !')
  });

CLI (install the module globally):

svgicons2svgfont icons/directory font/destination/file.svg

Options (not plugged to CLI yet)

fontName

Type: String Default value: 'iconfont' The font family name you want.

fixedWidth

Type: Boolean Default value: false Creates a monospace font of the width of the largest input icon.

normalize

Type: Boolean Default value: false Normalize icons by scaling them to the height of the highest icon.

fontHeight

Type: Number Default value: MAX(icons.height) The outputted font height (defaults to the height of the highest input icon).

descent

Type: Number Default value: 0 The font descent. It is usefull to fix the font baseline yourself.

The ascent formula is: ascent = fontHeight - descent.

Grunt plugins

grunt-svgicons2svgfont and grunt-webfont.

Gulp plugins

Try gulp-iconfont and gulp-svgicons2svgfont.

Stats

NPM NPM

Contributing

Feel free to pull your code if you agree with publishing under the MIT license.

npm loves you