I have been trying to convert TTF to WOFF using various command line and online tools. I have tried following :
Command line :
- sfntwoff : https://people-mozilla.org/~jkew/woff/
- ttf2woff : http://wizard.ae.krakow.pl/~jb/ttf2woff/
- ruby gem : https://coderwall.com/p/kyc8lw/convert-fonts-from-the-command-line
Online :
- font squirrel : https://www.fontsquirrel.com/tools/webfont-generator
- transfonter : http://transfonter.org/
I have ttf file of size ~220KB. All these tools generate woff file of size around 100KB except for font-squirrel which generates a size optimized file of ~20KB.
I am curious as to what font-squirrel does which no other command-line (read open source) tool is able to do. And if possible how can I do the same via command-line, even if it involves writing or hacking some code.
Simply doing WOFF compression should yield very similar file sizes, regardless of tool used.
I expect Font Squirrel is doing more to account for that extra 80kB savings, like stripping hints, dropping OpenType features like small caps, or subsetting to support only western languages.
You could use TTX/FontTools to inspect the files before and after conversion, and see what's changed.