GithubHelp home page GithubHelp logo

gulp-webfont's Introduction

gulp-webfont

Generate custom icon webfonts from SVG files via Gulp. Copied from and inspired by grunt-webfont.

Only fontforge engine is supported

Installation

This plugin requires Gulp 3.9. Note that ttfautohint is optional, but your generated font will not be properly hinted if it's not installed. And make sure you don't use ttfautohint 0.97 because that version won't work.

OS X

brew install ttfautohint fontforge --with-python
npm install gulp-webfont --save-dev

You may need to use sudo for brew, depending on your setup.

Usage

var gulp = require('gulp');
var webfont = require('gulp-webfont');

var webfont_config = {
    types:'eot,woff2,woff,ttf,svg',
    ligatures: true
};

gulp.task('default', function () {
  return gulp.src('test/*.svg')
    .pipe(webfont(webfont_config))
    .pipe(gulp.dest('dist'));
});

gulp-webfont's People

Contributors

atomicpages avatar eduardomdantas avatar jvanaert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gulp-webfont's Issues

Error generating fonts

Hey, thanks for the plugin, appreciated.

I'm struggling to get it to run however. On gulp fonts I receive an error:

17:22:13] Starting 'fonts'...
Font icons with 3 glyphs created.
[17:22:13] icons.eot
[17:22:13] icons.woff
[17:22:13] icons.ttf
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, open '/tmp/d-11766-20220-1gyb7h8.p35drc0udi/icons.eot'
    at Error (native)

Here is my code:

var webfont_config = {
  // dest: './../public/css/fonts',
  // destCss: './../public/css/external',
  options: {
    font: 'three-d-repo',
    fontFilename: 'three-d-repo',
    htmlDemo: false
  }
}

gulp.task('fonts', function () {
  return gulp.src('./../icons/*.svg')
    .pipe(webfont(webfont_config))
    .pipe(print())
    .pipe(gulp.dest("./")))
});

Any ideas what might be wrong?

Path error on node v6

path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.extname (path.js:1431:5)
    at createFont (../node_modules/gulp-webfont/lib/createFont.js:183:43)
    at DestroyableTransform.endStream [as _flush] (../node_modules/gulp-webfont/index.js:35:3)

Hello, support for webpack?=)

You have a great tool.
Do you plan to support Webpack?
That would be really cool.

Thank you,

With respect,
Alexander.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.