DragonsInn / fontgen-loader

Automated webfont generation from SVG icons. Use with WebPack!
125 stars 42 forks source link

woff2 Support? #33

Open skipjack opened 7 years ago

skipjack commented 7 years ago

In the readme it states:

A font file for WOF, EOT, TTF and WOFF2. Also SVG, if you want. But there is a trend of removal within browsers - you can see more on caniuse.

However, when I include woff2 in my list of types, like so:

module.exports = {
    fontName: 'icons',
    files: [ '../icons/*.svg' ],
    baseClass: 'icon',
    classPrefix: 'icon-',
    fixedWidth: true,
    types: [ 'woff', 'woff2' ]
}

I get an error:

ERROR in ../~/css-loader!../~/fontgen-loader!./icon.font.js Cannot read property 'deps' of undefined

Am I missing something? Is woff2 not how I should specify it?

Aside from this issue, this loader is super handy and I really appreciate your work on it! I'd be willing to submit a PR for some grammar fixes and cleanup in the README if you wouldn't mind...

skipjack commented 7 years ago

Looking at the webfonts-generator docs I see it only lists:

Possible values: svg, ttf, woff, eot.

So maybe these docs just need to be updated.

UPDATE: And now I'm seeing there's already an issue over there.

jeerbl commented 7 years ago

As this repo is down, I created (jeerbl/webfonts-loader)[https://github.com/jeerbl/webfonts-loader] released on NPM so that you can get updates and fixes resolved.

Regarding woff2 support, a new version of webfonts-generator supporting it is being released #5.

jeerbl commented 7 years ago

webfonts-generator has been released with WOFF2 support so I released webfonts-loader v0.1.0 supporting it as well.