johanbrook / gulp-fontcustom

A gulp plugin that convert SVG files to font icons with Fontcustom
15 stars 4 forks source link

gulp-fontcustom

This is a gulp plugin that takes a bunch of SVG files and converts them to font icon files with Fontcustom.

Usage

npm install --save gulp-fontcustom
var gulp = require('gulp'),
    fontcustom = require('gulp-fontcustom')

gulp.src("./icons")
.pipe(fontcustom({
  font_name: 'myfont',  // defaults to 'fontcustom',
  'css-selector': '.prefix-{{glyph}}'
}))
.pipe(gulp.dest("./results"))

The following files will be generated into the results directory:

myfont-preview.html
myfont.css
myfont.eot
myfont.ttf
myfont.svg
myfont.woff

The fontcustom function above takes an options object and uses the same keys as the Fontcustom CLI uses. Check out the Fontcustom documentation for more info on all configuration options.

gulp-fontcustom will default to these options:

no_hash: true,
force: true

The --output option for Fontcustom is set inside of gulp-fontcustom and will thus precede any configuration.

Note that fontcustom must be installed on the system beforehand. If not:

# On Mac
brew install fontforge eot-utils
gem install fontcustom

See the Fontcustom docs for further instructions.

Stuff to do

Similar plugins

If this isn't your cup of tea:

License

MIT.