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

Plugin doesn't differentiate between woff and woff2 #1

Open
DenisLanz opened this issue Jun 12, 2015 · 3 comments
Open

Plugin doesn't differentiate between woff and woff2 #1

DenisLanz opened this issue Jun 12, 2015 · 3 comments

Comments

@DenisLanz
Copy link

I'm currently porting a project from Grunt to Gulp - simplefont64 was the closest I could find to fontoptim. Nevertheless if I pipe in woff and woff2 files simplefont doesn't differentiate between the MIME types data:application/font-woff and data:application/x-font-woff2
See:
http://www.w3.org/TR/WOFF/#appendix-b
https://gist.github.com/sergejmueller/cf6b4f2133bcb3e2f64a

@joshblack
Copy link
Owner

I totally understand, right now the plugin creates a simple buffer with the contents of the file. Unfortunately this looks like it means that it can't differentiate between the two file types right now. Sadly I haven't worked on this thing in a while, but I can try and land a fix sometime in the next week for this.

@joshblack
Copy link
Owner

Or feel free to submit a pull request and I'll merge it in.

@DenisLanz
Copy link
Author

I'm not really experienced with javascript and node, configuring is one thing but implementing it is another topic :) As far as I understood you're using node-mime to identify the mime-type, expanding the mime types like:

mime.define({
          'application/font-woff2': ['woff2'],
          'application/font-woff': ['woff']
});

should work, but I might be totally wrong. Maybe I'll try to make a gulp-fontoptim port someday.

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

2 participants