Google Web-fonts vs Actual font files - For all devices

こ雲淡風輕ζ 提交于 2019-12-22 05:35:09

问题


I'm looking to use Joesfin Sans. It's listed on Google web fonts. I also have the .eot, .svg, .ttf and the .woff. This means full compatibility with the files (as far as I know).

My main question is: which is better? Does Google Fonts load faster? Is it more compatible? Or should I stick with the files?


回答1:


If you want the quick and easy solution, embed the font loader code and move on. Google is frequently adding more options/features to their service.

Personally, I prefer to download the files from Google and work with them manually. Since there is a Google UI specifically for downloading your selected fonts (and from reading the license agreement) I believe this is legitimate use, but I'm not a lawyer.

Why do I do this?

  • I have experienced latency when accessing Google fonts (200-300ms). While this isn't terrible, most of my server environments respond faster and a font is an important prerequisite for a page. Any benefit from hitting a separate domain (i.e. parallelization to different hosts by the browser) is lost.

  • I've manually trimmed the font files to remove all unwanted glyphs. This results in a smaller file size.

  • IE8 support--it appears the .eot doesn't always get downloaded.

These reasons are mostly anecdotal but I have been much happier managing the font files myself.




回答2:


Using actual font files on your server is better in production because:

  1. It’s more robust. Consider what happens when Internet connections (from the user’s location) to Google servers do not work. Generally, don’t rely on remotely hosted services without good reason.
  2. It’s probably a little faster in the average.
  3. You are in control. Google has a long history of taking services down or changing them (e.g. to paid services).
  4. The way Google serves fonts has some bugs.

Naturally, you would need to do at least the same as Google does in an attempt to cover different platforms (with different font file formats).



来源:https://stackoverflow.com/questions/12715614/google-web-fonts-vs-actual-font-files-for-all-devices

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