FontFaceSet
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2020年1月.
* Some parts of this feature may have varying levels of support.
CSS 字体加载 API 的 FontFaceSet 管理着字体们的加载和可查询的字体们下载状态。
Properties
FontFaceSet.status只读-
表示 font-face's 的加载状态,可能是
'loading'或'loaded'
Events
FontFaceSet.onloading-
当
loading相关事件发生时触发EventListener,表示 font-face 集已经开始加载了。 FontFaceSet.onloadingdone-
当
loading相关事件发生时触发EventListener,表示 font-face 集已经完成加载了。 FontFaceSet.onloadingerror-
当
loading相关事件发生时触发EventListener,表示 font-face 集加载时产生了一个错误。
Methods
FontFaceSet.add()-
向字体集添加一个字体。
FontFaceSet.check()-
一个
Boolean用于表示一个字体是否加载完成,但它不回初始化你的加载。 FontFaceSet.clear()-
移除字体集的所有字体。
FontFaceSet.delete()-
从字体集中移除一个字体。
FontFaceSet.load()-
返回解析为请求的字体的列表的
Promise。 FontFaceSet.ready()-
准备操作已完成且开始解析字体时返回一个
Promise。
规范
| Specification |
|---|
| CSS Font Loading Module Level 3> # FontFaceSet-interface> |
浏览器兼容性
Loading…