FontFaceSet.check()
FontFaceSet
的check()
方法会返回是否在给定的字体列表中的所有字体已经被加载并可用。
语法
js
check(font)
check(font, text)
返回
如果字体列表可用,则Boolean
为 true
参数
示例
js
document.fonts.check("12px courier"); //如果字体快递可用在 12px,则返回 true
document.fonts.check("12px MyFont","ß"); 如果字体“MyFont”具有ß字符,则返回 true。
规范
Specification |
---|
CSS Font Loading Module Level 3 # dom-fontfaceset-check |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
check |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- Has more compatibility info.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.