Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OTS parsing error: incorrect file size in WOFF

When you try to download the font woff format, I received an error:

OTS parsing error: incorrect file size in WOFF header

What am I doing wrong ?

like image 460
soldovskij Avatar asked Nov 18 '15 14:11

soldovskij


1 Answers

This error can occur if you use a gulp or a grunt, forgetting to add fonts formats to src of task.

In my case, it happened when using gulp-rigger, which changes the contents of the file, taking it as text .

Since fonts file is a binary format, then output is broken file.

Fix for me:

gulp.task('start', function () {
    // with filter by file type (.js or .html)
    gulp.src(['./src/**/*.js', './src/**/*.html'])                 
        .pipe(rigger())
        .pipe(gulp.dest('./target'));
});

Instead:

gulp.task('start', function () {
    // all files, iclude fonts .woff
    gulp.src('./src/**/*.*') 
        .pipe(rigger())
        .pipe(gulp.dest('./target'));
});
like image 124
soldovskij Avatar answered Oct 23 '22 06:10

soldovskij