国内怎么使用Google Fonts?

已邀请:

zkbhj - 凯冰科技站长

赞同来自:

【使用方法】

把 //fonts.googleapis.com 替换为 //fonts.gmirror.org 即可。
 
还有其他可用的:
https://fonts.proxy.ustclug.org/ 
http://fonts.lug.ustc.edu.cn //中科大
fonts.css.network //捷速网络 香港
http://fonts.geekzu.org //Personal
http://fonts.gmirror.org //七牛

作者:dasccc
链接:https://www.zhihu.com/question ... 67623
来源:知乎
著作权归作者所有,转载请联系作者获得授权。

 
【原理】

用户请求 https://fonts.gmirror.org/css 时,后端程序会自动获取 https://fonts.googleapis.com/css 对应的内容,把其中的 fonts.gstatic.com 替换为 fonts-gstatic-com.gmirror.org(七牛),css缓存在后端服务器上,字体文件通过七牛自动拉取。

比如

https://fonts.gmirror.org/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700



http://fonts.gmirror.org/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700

都对应

https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700
 
另外的解决方案:
 
1.替换为原来的:fonts.googleapis.com,已恢复访问。地址是国内的。

2.下载保存到本地,从自己服务器加载。


 

要回复问题请先登录注册