nfroidure / ttf2woff2

Convert ttf files to woff2.
MIT License
297 stars 39 forks source link

Fix CLI example to use > instead of >> #53

Closed mikehaertl closed 4 years ago

mikehaertl commented 4 years ago

IMO the usage example should be:

cat font.ttf | ttf2woff2 > font.woff2

and not

cat font.ttf | ttf2woff2 >> font.woff2

A >> will append the output to an existing file whereas > will create a new file.

We blindly copied that into our build script and where surprised by Chrome warnings like:

Failed to decode downloaded font: http://****/icons.woff2?d40450c754 OTS parsing error: Size of decompressed WOFF 2.0 is less than compressed size

The file had grown to 100KB, while the font actually only had 3KB.