How can I only use Latin subset with Google Fonts WOFF2 files?

落爺英雄遲暮 提交于 2019-11-29 09:13:51

The trick lies with this optimization:

unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;

With this, the browser knows whether it needs to download the font, depending on the characters it just loaded in the html. Chrome is currently the only one with full support for this.

MDN lists Firefox 36+ as completely ignoring this spec, therefore Google Fonts has to serve it a minimal font-face specification. The same happens with Safari.

Anyway, that was an interesting 30 minute journey on the internet which I hope helps any further internet travellers. This should lend weight towards why you could use Google Fonts as a CDN for hosting fonts for optimal performance as opposed to serving it yourself.

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