问题
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