W3C home > Mailing lists > Public > www-font@w3.org > July to September 2009

Webfont compression

From: Laurence Penney <lorp@lorp.org>
Date: Tue, 21 Jul 2009 16:29:24 +0100
Message-Id: <8118A1D0-E454-41C9-A116-6B1BF78B76D5@lorp.org>
To: www-font <www-font@w3.org>
It seems to me the benefits of Monotype's Microtype Express  
compression are being oversold. Until recently I was under the  
impression that its patented font-specific algorithms performed  
significantly better than normal compression.

But then I actually ran some tests, comparing WEFT compression and  
gzip compression:

                    Georgia  Vera Sans Mono
TTF                 155068           49224
EOT (ttf2eot[1])    155234           49454
EOT (WEFT)           73907           24113
TTF (gzip)           97965           27971
EOT (ttf2eot+gzip)   98013           28038
EOT (WEFT+gzip)      73920           24058

This demonstrates first of all that the zip compression of Tal &  
Erik's .webfont proposal is almost as good as the dedicated MTX method.

But more interestingly, gzip compression is built into both browsers  
and Apache[2]. For example, this webfont demo page, hosted at cheap  
shared hosting company, is serving compressed TTF and EOT as well as  
compressed HTML:

http://www.lorp.org/webfont/

While HTML is often compressed by default, a single line in Apache  
'SetOutputFilter DEFLATE' compresses all served files (though of  
course in practice this would be better done on a per-filetype basis).

(By the way, another Apache line 'RewriteRule ^(.*)\.ttf$ /webfont/ 
$1.eot [L]' allows the @font-face CSS in that demo page to be the same  
for IE and non-IE browsers, referring always to .ttf files.)

For the record, of about a dozen websites I checked using  
GIDZipTest[3], these were the only ones serving uncompressed data:

www.monotypeimaging.com
www.ascendercorp.com
www.w3c.org
www.tiro.com

- L

[1] http://code.google.com/p/ttf2eot/
[2] http://httpd.apache.org/docs/2.0/mod/mod_deflate.html
[3] http://www.gidnetwork.com/tools/gzip-test.php
Received on Tuesday, 21 July 2009 15:30:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 11 June 2011 00:14:03 GMT