这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
check()
方法在
FontFaceSet
returns whether all fonts in the given font list have been loaded and are available.
bool = aFontFaceSet.check(font); bool = aFontFaceSet.check(font, text);
A
布尔
that is true if the font list is available
font
: a font specification using the
CSS value syntax
, e.g. "italic bold 16px Roboto"
text
: limit the font faces to those whose Unicode range contains at least one of the characters in text. This
does not check for individual glyph coverage
.
document.fonts.check("12px courier"); // returns true if the font courier is available at 12px
document.fonts.check("12px MyFont", "ß"); // returns true if the font 'MyFont' has a ß character.
| 规范 | 状态 | 注释 |
|---|---|---|
|
CSS Font Loading Module Level 3
The definition of 'check' in that specification. |
工作草案 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
check
|
Chrome 35 | Edge ≤79 | Firefox 41 | IE ? | Opera ? | Safari 10 | WebView Android 37 | Chrome Android 35 | Firefox Android 41 | Opera Android ? | Safari iOS Yes | Samsung Internet Android 4.0 |
完整支持
兼容性未知
实验。期望将来行为有所改变。
FontFaceSet
check()
load()