Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I want to use @font-face in my css but I have a lot of fonts. Does anyone know of any software will let me to compress my fonts?

share|improve this question
6  
Use fewer fonts. If you have so many that you're worried about bandwidth, your website is almost guaranteed to be impossible to read. –  Cody Gray Mar 27 '11 at 15:03
add comment

migrated from stackoverflow.com Mar 27 '11 at 15:44

This question came from our site for professional and enthusiast programmers.

2 Answers

Check http://www.fontsquirrel.com/fontface/generator

share|improve this answer
    
excellent. tanks –  yaser Mar 28 '11 at 5:25
add comment

If you add the following lines of code to your .htaccess file, it will compress the fonts and cause them to be cached in the user's browser allowing you to use more fonts than you might otherwise be inclined to get away with.

The following will declare the font types to the browser.

AddType font/ttf .ttf
AddType font/otf .otf
AddType font/x-woff .woff
AddType image/svg+xml .svg
AddType application/vnd.ms-fontobject .eot

The following will set the fonts to cache in your users browser.

ExpiresByType font/ttf "access plus 10 years"
ExpiresByType font/otf "access plus 10 years"
ExpiresByType application/vnd.ms-fontobject "access plus 10 years"
ExpiresByType font/x-woff "access plus 10 years"
ExpiresByType image/svg+xml "access plus 10 years"

The following will compress the fonts before sending them to the user

AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.