这篇翻译不完整。请帮忙从英语翻译这篇文章。
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 |
浏览器兼容性
这个兼容性表格是从结构数据自动生成的。如果你有兴趣来贡献这个数据,请查看 https://github.com/mdn/browser-compat-data 并给我们发pull request。
Update compatibility data on GitHub
Desktop | Mobile | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Basic support | Chrome Full support 60 | Edge No support No | Firefox
Full support
41
| IE No support No | Opera Full support 47 | Safari Full support 10 | WebView Android Full support 60 | Chrome Android Full support 60 | Edge Mobile No support No | Firefox Android Full support Yes | Opera Android Full support 47 | Safari iOS Full support 10.2 | Samsung Internet Android Full support 5.0 |
Legend
- Full support
- Full support
- No support
- No support
- User must explicitly enable this feature.
- User must explicitly enable this feature.
参考资料
FontFaceSet
interfaceFontFace