Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Woff2 format option kills my gulp build process randomly #22

Closed
bm2u opened this issue Nov 27, 2015 · 7 comments
Closed

Woff2 format option kills my gulp build process randomly #22

bm2u opened this issue Nov 27, 2015 · 7 comments
Assignees

Comments

@bm2u
Copy link

bm2u commented Nov 27, 2015

After updating npm from 0.12.7 to 4.2.2 and gulp-iconfont from 5.0.0 to 5.0.1. Woff2 format option kills my build process randomly with Process finished with exit code -1073740940 (0xC0000374). Unfortunately there is no deeper logging oder details to provide, but leaving the woff2 format option solves the problem. Maybe be a clue to follow. Has anybody got an idea about how to convert ttf to woff2 in the meantime, except downgrading? Im running on windows 8.1.

The responsible gulp tasks:

gulp.task('iconfont:clean', function() {
    return del(config.dest);
});

gulp.task('iconfont:make', ['iconfont:clean'], function() {
    return gulp.src(config.src)
        .pipe(svgmin())
        .pipe(gulp.dest(config.tmp))
        .pipe(iconfont(config.options))
        .on('glyphs', makestyles)
        .pipe(gulp.dest(config.dest));
});

The 'makestyles' as follows.

module.exports = function(glyphs) {

    var options = {
        glyphs: glyphs,
        fontName: config.options.fontName,
        fontPath: config.fontDest,
        className: config.className,
        longName: config.name,
        projectName: project.name,
        projectVersion: project.version,
        pseudo: config.pseudo
    };

    // Generates scss file
    gulp.src(config.templateScss)
        .pipe(consolidate('lodash', options))
        .on('error', console.error.bind(console))
        .pipe(rename(config.scssOutputName))
        .pipe(gulp.dest(config.scssDest));
};

Options for running gulp-iconfont

options: {
    fontName: 'MyIconFont',
    appendUnicode: true,
    normalize: true,
    descent: 70,
    ascent: 420,
    formats: ['ttf', 'eot', 'woff', 'woff2', 'svg'],
    timestamp: runTimestamp,
    fontHeight: 512
}
@nfroidure
Copy link
Owner

Thank you but you forgotten to provide the SVG/TTF fonts in order to reproduce the problem.

@nfroidure
Copy link
Owner

@bm2u also, can you tell me if the font is generated with the emscripten fallback or the C++ add-on and on which platform (os, node version).

@bm2u
Copy link
Author

bm2u commented Dec 9, 2015

When the build process crashs - unfortunately no font file were generated. To get the result of a successful build, please refer to myfont.zip (ttf/svg & woff2). How can I verify the way of converting I am using (emscript fallback or C++). I guess I'm running the emscripten fallback. Operating system is windows 8.1 and currently running with node.js 5.1.1.

@nfroidure
Copy link
Owner

@bm2u in fact you can force one or another by simply deleting the native build files in node_modules/ttf2woff2/build or by modifying those lines https://github.com/nfroidure/ttf2woff2/blob/master/src/index.js#L3-L5

I don't need the woff2 output but simply the ttf font inputted. To get it you just have to remove the woff2 format from the options and give me the ttf font generated that way.

@bm2u
Copy link
Author

bm2u commented Dec 9, 2015

ok - I'm gonna force both ways separately and will come back later. The (myfont.zip) contains the requested ttf-file as well.

@bm2u
Copy link
Author

bm2u commented Feb 9, 2016

@nfroidure I've tried both ways and figured out that the jssrc-way is more reliable (no failure at all). The addon.node-way kills my entire workflow several times. Please refer to myBothWaysFont.zip for the results.

Is there an opportunity to force the jssrc-way via config attribute? Otherwise local changes @ttf2woff2 will be gone after the next update.

@nfroidure
Copy link
Owner

It is certainly possible but would need some code refactoring though. I'll consider it for the next release, fell free to PR in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants