我想用谷歌字体添加一个字体,我注意到一个奇怪的行为。
我想添加一个只有拉丁子集的字体,我不想要 latin-ext、cyrillic 或 cyrillic-ext 子集,以减轻代码的负担。我知道这是默认行为,所以我这样做了:
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Philosopher">
在 Firefox(以及其他不支持 WOFF2 的浏览器)中,我得到了正确的输出:
@font-face {
font-family: 'Philosopher';
font-style: normal;
font-weight: 400;
src: local('Philosopher'), url(http://fonts.gstatic.com/s/philosopher/v7/OttjxgcoEsufOGSINYBGLbrIa-7acMAeDBVuclsi6Gc.woff) format('woff');
}
但是在 Chrome 中,我得到了这个:
/* cyrillic */
@font-face {
font-family: 'Philosopher';
font-style: normal;
font-weight: 400;
src: local('Philosopher'), url(http://fonts.gstatic.com/s/philosopher/v7/OttjxgcoEsufOGSINYBGLV4sYYdJg5dU2qzJEVSuta0.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin */
@font-face {
font-family: 'Philosopher';
font-style: normal;
font-weight: 400;
src: local('Philosopher'), url(http://fonts.gstatic.com/s/philosopher/v7/OttjxgcoEsufOGSINYBGLZQV2lvL5Ba9FjAYK6Lx0Qk.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
我想,也许拉丁语子集不再是默认行为,所以我添加到我<link>
的subset
GET 参数中:
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Philosopher&subset=latin">
但它并没有改变输出。当我使用 a&subset=cyrillic
时,它在 Firefox 中会发生变化,但 Chrome 输出是相同的。
有没有办法只输出拉丁子集?
或者只是如果页面上不需要,不会下载 WOFF2 和 unicode-range ?在最后一种情况下,剥离西里尔文调用的收益只是 css 文件中的 8 行代码,也就是说大约 300 字节,这不值得吗?