Can someone provide an example of how to gzip a webfont kit? The generator provided me with this code...what needs changed around?
@font-face {
font-family: 'DesigersBold';
src: url('desib__-webfont.eot');
src: url('desib__-webfont.eot?#iefix') format('embedded-opentype'),
url('desib__-webfont.woff') format('woff'),
url('desib__-webfont.ttf') format('truetype'),
url('desib__-webfont.svg#DesigersBold') format('svg');
font-weight: normal;
font-style: normal;
}
Are you using Apache and have access to httpd.conf? If so, is gzip compression already enabled?
You can look for this line:
AddOutputFilterByType DEFLATE
Or
SetOutputFilter DEFLATE
If it's the former, you should be able to add the following MIME types so the directive and parameters look like the one below. The MIME types declared here are for .EOT, .TTF, and .SVG. I pulled them from the mime.types file in my Apache conf folder. I believe .WOFF is already compressed so you do not need to have it gzipped.
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject application/x-font-ttf image/svg+xml
The latter directive SetOutputFilter gzips all files within the container it is stated in. If this location includes your font files, they should already be gzipped when delivered to the client.
Send some parameters (bogus), server will treat these responses as text/plain, and just compress as of text/plain if DEFLATE is set on text/plain.
@font-face {
font-family: 'DesigersBold';
src: url('desib__-webfont.eot?v=1');
src: url('desib__-webfont.eot?v=1#iefix') format('embedded-opentype'),
url('desib__-webfont.woff?v=1') format('woff'),
url('desib__-webfont.ttf?v=1') format('truetype'),
url('desib__-webfont.svg?v=1#DesigersBold') format('svg');
font-weight: normal;
font-style: normal;
}
It just works fine!