Compressing fonts for using in web

痞子三分冷 提交于 2020-01-10 14:19:25

问题


Can fonts be compressed someway before using as webfonts? I have a font file which is 150kB. Is it possible to compress it down.

And also if i call for both font .eot and .ttf will both be downloaded by browsers?


回答1:


If you use the FontSquirrel @font-face kit generator - http://www.fontsquirrel.com/fontface/generator - and choose the expert setting, you can manipulate the settings to achieve a little better compression.




回答2:


You can compress .woff font files with https://github.com/hn/woff-compress. It uses zlib's Z_BEST_COMPRESSION flag or Zopfli to losslessly shrink files down to a minimum.

If you want to lossy reduce files even more, you can remove unneeded glyphs from the font as discussed in Way to reduce size of .ttf fonts?.



来源:https://stackoverflow.com/questions/6082336/compressing-fonts-for-using-in-web

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!