ecomfe / fontmin

Minify font seamlessly
http://ecomfe.github.io/fontmin
MIT License
5.77k stars 315 forks source link

Doesn't work! #36

Open shavidzet opened 8 years ago

shavidzet commented 8 years ago

In my case font.ttf size is 51 KB. After using fontmin it creates for me new .ttf font but the size is the same. What's going wrong?

bartvanandel commented 8 years ago

You have to use the Glyph plugin to specify which glyphs to keep. If you want to keep everything, I don't think it is likely that you will get a much smaller font.

manast commented 8 years ago

I am testing the following code and it doesnt seem to work actually:

      var fontmin = new Fontmin()
        .src(fontdata)
        .use(Fontmin.glyph({
          text: 'a',
        }))
       .dest('result');

       fontmin.run(...);

fontdata is a font in otf format. What I get is the font in woff2 format, but it is always exactly the same size independently of what text I use in the glyph plugin. Also, why do I get woff2 files? how can I get just plain woff or ttf files?

manast commented 8 years ago

After some more testing. Seems like using woff and woff2 as input does not really work, its as if the data just passes through, on the other hand, when using ttf as input the subsetting works.