【发布时间】:2016-04-19 08:56:03
【问题描述】:
我需要什么
- 我需要压缩字体文件(从 500 kb ->200 kb)。
- 我用 google 搜索过,但没有发现任何重新分级此上下文的内容。
- 我尝试过使用 nginx 设置,但默认情况下它可以工作 .woff ,但我想要压缩 .eof 、.ttf、.svg 。
根据我们的要求,我们没有使用谷歌字体,我已经阅读了谷歌字体论坛,发现 fonts.googleapis.com/css?family=FontName&text=Lorem%20Ipsum 在使用字体时可以节省文件大小。
但我需要压缩 .ttf、.eot、.svg 字体。
还有其他方法可以节省字体大小吗?
-
我已经在 .htacess 文件中尝试过
RewriteEngine on RewriteCond $1 !^(index\.php|public|\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?$1 <ifmodule mod_deflate.c> <ifmodule mod_mime.c> Addtype font/opentype .otf Addtype font/eot .eot Addtype font/truetype .ttf </ifmodule> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript application/javascript text/text font/opentype $ </ifmodule> - 我已经下载了http://fontforge.github.io/en-US/downloads/gnulinux/fontforge,但我无法通过这个工具压缩字体
【问题讨论】: