A
A
Alexander Epikhin2015-07-23 22:48:36
gulp.js
Alexander Epikhin, 2015-07-23 22:48:36

How to make gulp-fontgen work?

Can't get gulp-fongen to work.
gulpfile.js:

var gulp = require("gulp");
var fontgen = require("gulp-fontgen");

gulp.task('fontgen', function () {
    gulp.src('app/fonts/**/*.ttf')
        .pipe(fontgen({dest: 'dist/'}))
});

The paths are correct, the font file is in the specified directory.
fontfacegen, gulp-util, through2 installed with the --save-dev key I start the
task, and it tells me:
[22:36:23] Starting 'fontgen'...
[22:36:23] Finished 'fontgen' after 15 ms

And it stops on the last line, i.e. does not actually complete and no result.
Please tell me what could be the problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Artem Malko, 2015-07-24
@artemmalko

I still recommend this package https://github.com/ecomfe/fontmin It can reduce the size of generated fonts. font-gen generates very large fonts.
In general, it's better to quit this idea and use www.fontsquirrel.com The service allows you to generate the correct css and files of the optimal size.

V
Vladimir Abiduev, 2015-07-24
@gunlinux

gulp.task('fontgen', function () {
    return gulp.src('app/fonts/**/*.ttf')
        .pipe(fontgen({dest: "./dest/"}))
        .pipe(gulp.dest('dist');
});

Rather so

A
Alexander Epikhin, 2015-07-24
@leshiple

Sorry for not replying for so long. Corrected. The result is the same, it stops on the second line and that's it.
I found here gulpfile.js where it is written how to use gulp-fontgen:

// FONT GENERATION TASK
gulp.task('fontgen', function(){
  return gulp.src(paths.fonts.src)
  .pipe(fontgen({
    dest: paths.fonts.dest
  }));
});

In dependencies, the author writes:
brew install Caskroom/cask/xquartz
brew install fontforge ttfautohint ttf2eot bat

I understand that Homebrew for OS X, and I have Windows 8.1
Installed Fontforge , ttfautohint , gulp-ttf2eot and that's it. Didn't give any result.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question