WorkerGlobalScope: fonts 属性
注意:此功能仅在 Web Workers 中可用。
WorkerGlobalScope 接口的 fonts 属性返回 worker 的 FontFaceSet 接口。
此属性是 CSS 字体加载 API 的一部分。
值
返回值是 worker 的 FontFaceSet 接口。FontFaceSet 接口可用于加载新字体、检查先前加载字体的状态等。
示例
在所有字体加载后执行操作
js
fonts.ready.then(() => {
// Any operation that needs to be done only after all the fonts
// have finished loading can go here.
});
规范
| 规范 |
|---|
| CSS 字体加载模块等级 3 # dom-fontfacesource-fonts |
浏览器兼容性
加载中…