Mobile app version of vmapp.org
Login or Join
Margaret670

: Font compressor 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?

@Margaret670

Posted in: #Fonts

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?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Margaret670

2 Comments

Sorted by latest first Latest Oldest Best

 

@Frith620

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme