OTS parsing error: incorrect file size in WOFF
Asked Answered
G

1

9

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 ?

Graphophone answered 18/11, 2015 at 14:13 Comment(0)
G
3

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'));
});
Graphophone answered 18/11, 2015 at 14:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.