fonts

翻译不完整。 请帮助我们翻译这篇文章!

Document的 fonts 属性接口返回文档的 FontFaceSet 接口。

语法

let fontFaceSet = document.fonts;

返回值是文档的 FontFaceSet 接口。FontFaceSet 接口对 加载新字体、检查已加载字体的加载状态 来说非常有用。

例子

在所有字体加载完成后进行操作

document.fonts.ready.then(function() {
  // 字体加载完成后的逻辑
});

说明

Specification Status Comment
CSS Font Loading Module Level 3
FontFaceSet
Working Draft Initial definition

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
fontsChrome Full support 35Edge Full support 79Firefox Full support 41IE No support NoOpera Full support 22Safari Full support 10WebView Android Full support ≤37Chrome Android Full support 35Firefox Android Full support 41Opera Android Full support 22Safari iOS Full support 10Samsung Internet Android Full support 3.0

Legend

Full support  
Full support
No support  
No support

参考资料