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

OTS parsing error #40

Open
fyyyyy opened this issue Oct 26, 2016 · 12 comments
Open

OTS parsing error #40

fyyyyy opened this issue Oct 26, 2016 · 12 comments

Comments

@fyyyyy
Copy link

fyyyyy commented Oct 26, 2016

We are getting this error since yesterday
FortAwesome/Font-Awesome#9352

It works fine on local, but when deployed, the browser fails to parse.

Failed to decode downloaded font: http://xyz.com/fonts/fontawesome-webfont.woff2?v=4.7.0
xyz.com/:1 OTS parsing error: invalid version tag
xyz.com/:1 Failed to decode downloaded font: http://xyz.com/fonts/fontawesome-webfont.woff?v=4.7.0
xyz.com/:1 OTS parsing error: invalid version tag
xyz.com/:1 Failed to decode downloaded font: http://xyz.com/fonts/fontawesome-webfont.ttf?v=4.7.0
xyz.com/:1 OTS parsing error: invalid version tag

@fyyyyy
Copy link
Author

fyyyyy commented Oct 26, 2016

https://github.com/components/font-awesome/blob/master/css/font-awesome.css#L7
This line seems to be the problem

@font-face {
  font-family: 'FontAwesome';
  src: url('../fonts/fontawesome-webfont.eot?v=4.7.0');
  src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
  font-weight: normal;
  font-style: normal;
}

@volumio
Copy link

volumio commented Oct 27, 2016

Confirm, does not work on my Travis CI istance...

@fyyyyy
Copy link
Author

fyyyyy commented Oct 28, 2016

Our workaround was to use a different gulp task for fontawesome.
The first task always worked, but no longer does. So we added the second task just for fontawesome.

// Only applies for fonts from bower dependencies
// Custom fonts are handled by the "other" task
// no longer works for fontawesome
gulp.task('fonts', function() {
    return gulp.src($.mainBowerFiles())
        .pipe($.filter('**/*.{eot,svg,ttf,woff,woff2}'))
        .pipe($.flatten())
        .pipe(gulp.dest(path.join(conf.paths.dist, '/fonts/')));
});

gulp.task('fontawesome', function() {

  return gulp.src('bower_components/components-font-awesome/fonts/*.*')

          .pipe(gulp.dest(path.join(conf.paths.dist, '/fonts/')));
});

gulp.task('build', ['html', 'fonts', 'fontawesome', 'other', 'sentry']);

@TheWrongAlice
Copy link

Having the same issue. Will there be a new release with a fix?

@FredLackeyOfficial
Copy link

Is there a solution for this?

@RobLoach
Copy link
Member

RobLoach commented Dec 3, 2016

Make sure to have Font Awesome install the CSS and assets to the right place. It's referencing ../fonts in this case, so make sure your web server deploys them to the right location.

@danielmahadi
Copy link

danielmahadi commented Dec 5, 2016

Hi,

In my case, i have arrange the files as follow:

wwwroot

  • css
    • font-awesome.css
  • fonts
    • fontawesome-**.*

And I can see that the fonts are loaded in my browser (chrome), but I still get this error:
Failed to decode downloaded font: http://localhost:5000/fonts/fontawesome-webfont.woff2?v=4.7.0
Dashboard#/menu?_k=wtjpz9:1 OTS parsing error: Failed to convert WOFF 2.0 font to SFNT

Am I the only one here? Anyone can point me to the right solution?

@danielmahadi
Copy link

danielmahadi commented Dec 5, 2016

Hi Guys,

I tried to reinstall the fontawesome package from bower.. and now it works just fine.
Please try to reinstall / redownload the font files.

Hope this solve the issue. 😄

@Axiol
Copy link

Axiol commented Jan 16, 2017

I still have the issue with 4.7.0 I completely removed the package and reinstalled it through Bower but the error is still there.

Any update?

@razor9999
Copy link

in the bower.json
"main": [
"css/font-awesome.css"
],
in version 4.7
All fonts file was removed from tag main so that why below code does not work
gulp.task('fonts', function() {
return gulp.src($.mainBowerFiles())
.pipe($.filter('**/*.{eot,svg,ttf,woff,woff2}'))
.pipe($.flatten())
.pipe(gulp.dest(path.join(conf.paths.dist, '/fonts/')));
});

@hermeslm
Copy link

I had this problem and in my case was Git treating the file as a text file, and messing with its "line endings". This was corrupting the file. you can check this stackoverflow answers for some solutions:

@aguynamedben
Copy link

Same thing happened to me that happened to @hermeslm—git corrupted the line endings so I had to create a .gitattributes file and force git to treat .ttf files as binary.

I noticed there was some weird commit with the .ttf files, and after I had created a .gitattributes file, but I guess I didn't realize I need to revert the odd commit git wanted to make to the .ttf files themselves.

The red herring for me was that I'm using webpack, url-loader/file-loader, Electron, etc.

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

No branches or pull requests

10 participants