Google Chrome Developers says:
The new WOFF 2.0 Web Font compression format offers a 30% average gain over WOFF 1.0 (up to 50%+ in some cases). WOFF 2.0 will be available from Chrome M36 (beta) and there on.
Some examples of file size differences: WOFF vs. WOFF2
I have installed Googles compression library on a DigitalOcean (ref) server. Feel free to start the convert from TTF to WOFF2. No software installation required. Simply use your terminal window.
Mac OS users can use the TTF to WOFF2 application (created with Automator). Drag your TTF file to the application, the WOFF2 file will be created.
curl --data-binary "@/local/path/font.ttf" -o "/local/path/font.woff2" -H "Content-Type: font/ttf" -H "Accept: font/woff2" -X POST http://188.226.250.76Notes:
@/local/path/font.ttfis the local path to your TTF file (including the leading @ character)./local/path/font.woff2is the local path for the converted WOFF2 file.- Please don't change the header (Content-Type and Accept).
- Max TTF file size: 1 MB
Webdevelopers, make your life easier and webpages faster!
@font-face {
font-family: MyFont;
src:
url('myfont.woff2') format('woff2'),
url('myfont.woff') format('woff');
}Of course you can use WOFF2 as a Base64 encoded string:
@font-face {
font-family: MyFont;
src:
url('data:font/woff2;base64,...') format('woff2'),
url('data:font/woff;base64,...') format('woff');
}- No serverside GZIP compression for WOFF files, because WOFF already contains compressed data.
- Think about the correct mime type for WOFF 2.0 files (Google uses font/woff2, W3C recommends application/font-woff2):
types {
font/woff2 woff2;
}AddType font/woff2 .woff2- Google Chrome 36
@reklis
Thanks.