gulp-fontcustom

0.1.2 • Public • Published

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

  • Enable putting stylesheets/preview HTML in another destination
  • Support all relevant configuration options in Fontcustom
  • Better tests ...

Similar plugins

If this isn't your cup of tea:

License

MIT.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    62
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    62
  • 0.1.1
    1
  • 0.1.0
    1

Package Sidebar

Install

npm i gulp-fontcustom

Weekly Downloads

64

Version

0.1.2

License

MIT

Last publish

Collaborators

  • johanbrook