How to use gulp-iconfont - 3 common examples

To help you get started, we’ve selected a few gulp-iconfont examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Skyscanner / backpack / packages / bpk-svgs / gulpfile.babel.js View on Github external
const generateFont = (name = 'BpkIcon') =>
    gulp
      .src('src/icons/**/*.svg')
      .pipe(chmod(0o644))
      .pipe(
        iconfont({
          metadataProvider: getIconFontMetadataProvider(
            'tasks/codepoints.json',
          ),
          fontName: name,
          formats: ['ttf', 'eot', 'woff'],
          /**
           * Normalize and fontHeight(>1000) are needed in order to have all the glyphs rendered
           * correctly, for more info go to the npm package docs
           * https://www.npmjs.com/package/gulp-iconfont
           */
          normalize: true,
          fontHeight: 1001,
          timestamp: 1436442578, // A static timestamp to prevent changes showing up in git, backpack's first commit!
        }),
      );
github erudit / eruditorg / tools / static / gulpfile.babel.js View on Github external
gulp.task('build-iconfont', function(){
  let runTimestamp = Math.round(Date.now()/1000);
  return gulp.src([iconfont_dir + '/**/*.svg'])
    .pipe(iconfont({
      fontName: 'erudicon',
      formats: ['ttf', 'eot', 'woff', 'svg'],
      normalize: true,
      fontHeight: 1001,
      timestamp: runTimestamp
    }))
    .on('glyphs', function(glyphs, options) {
      // CSS templating, e.g.
      gulp.src(iconfont_dir + '/template.scss')
        .pipe(consolidate('lodash', {
          glyphs: glyphs,
          fontName: 'erudicon',
          fontPath: '/static/fonts/erudicon/',
          className: 'erudicon'
        }))
        .pipe(rename('_erudicon.scss'))
github KawashiroNitori / Anubis / gulpfile.babel.js View on Github external
gulp.task('iconfont', () => {
    return gulp
        .src('anubis/ui/misc/icons/*.svg')
        .pipe(svgmin())
        .pipe(gulp.dest('anubis/ui/misc/icons'))
        .pipe(iconfont({
            fontHeight: 1000,
            prependUnicode: false,
            descent: 6.25 / 100 * 1000,
            fontName: 'anubisIcon',
            formats: ['svg', 'ttf', 'eot', 'woff', 'woff2'],
            timestamp: iconTimestamp,
            normalize: true,
        }))
        .on('glyphs', (glyphs, options) => {
            gulp
                .src('anubis/ui/misc/icons/template/*.styl')
                .pipe(nunjucks.compile({glyphs, options}))
                .pipe(gulp.dest('anubis/ui/misc/.iconfont'))
        })
        .pipe(gulp.dest('anubis/ui/misc/.iconfont'));
});

gulp-iconfont

Create icon fonts from several SVG icons

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Popular gulp-iconfont functions