我不知道浏览器是如何实现它的,但
CSS Fonts Module Level 3在其“
Font loading guidelines”部分中说,浏览器必须只下载当前页面中使用的字体:
The @font-face rule is designed to allow lazy loading of fonts, fonts are only downloaded when needed for use within a document. A stylesheet can include @font-face rules for a library of fonts of which only a select set are used; user agents must only download those fonts that are referred to within the style rules applicable to a given page. User agents that download all fonts defined in @font-face rules without considering whether those fonts are in fact used within a page are considered non-conformant.
所以,无论如何,在你的代码中你不能指定任何特定的行为,如果浏览器是兼容的,它将只下载每个页面所需的那些.
另一个考虑因素是浏览器是否会将当前页面中声明的字体下载为后备但未真正使用.在这种情况下,规范说它是可选的:
In cases where a font might be downloaded in character fallback cases, user agents may download a font if it’s listed in a font list but is not actually used for a given text run.