这篇文章:网络字体什么时候加载,你可以预加载它们吗?,说使用本地来利用已经加载的字体。我找不到任何其他方式来预加载网络字体。
但是,我不知道应该为本地引用使用什么名称。在 MacOSX 中,多个变体显示为相同的字体名称。例如,我认为本地的(“Helvetica Neue Light”)在字体书中可用作“Helvetica Neue”......我如何引用不同的变体?
@font-face {
font-family: 'ProximaNova';
font-weight: normal;
font-style: normal;
src: url('/fonts/proximanova/ProximaNova-Reg-webfont.eot');
src: local("Proxima Nova Regular"), url('/fonts/proximanova/ProximaNova-Reg-webfont.eot?#iefix') format('embedded-opentype'),
url('/fonts/proximanova/ProximaNova-Reg-webfont.woff') format('woff'),
url('/fonts/proximanova/ProximaNova-Reg-webfont.ttf') format('truetype'),
url('/fonts/proximanova/ProximaNova-Reg-webfont.svg#webfont') format('svg');
}
@font-face {
font-family: 'ProximaNova';
font-weight: $light_weight;
font-style: normal;
src: url('/fonts/proximanova/ProximaNova-Light-webfont.eot');
src: url('/fonts/proximanova/ProximaNova-Light-webfont.eot?#iefix') format('embedded-opentype'),
url('/fonts/proximanova/ProximaNova-Light-webfont.woff') format('woff'),
url('/fonts/proximanova/ProximaNova-Light-webfont.ttf') format('truetype'),
url('/fonts/proximanova/ProximaNova-Light-webfont.svg#webfont') format('svg');
}
所有变体仍然会导致对 chrome 中的 woff 文件的请求。此外,我找不到任何关于网络字体的最新或当前最佳实践或如何优化它们的性能,我该如何阻止这些请求?