这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
FontFace
interface represents a single usable font face. It allows control of the source of the font face, being a URL to an external resource, or a buffer; it also allows control of when the font face is loaded and its current status.
FontFace()
FontFace
object, built from an external resource described by an URL or from an
ArrayBuffer
.
This interface doesn't inherit any property.
FontFace.display
CSSOMString
that determines how a font face is displayed based on whether and when it is downloaded and ready to use.
FontFace.family
CSSOMString
that retrieves or sets the
系列
of the font. It is equivalent to the
font-family
descriptor.
FontFace.featureSettings
CSSOMString
that retrieves or sets infrequently used font features that are not available from a font's variant properties. It is equivalent to the
font-feature-settings
descriptor.
FontFace.loaded
只读
Promise
that resolves with the current
FontFace
object when the font specified in the object's constructor is done loading or rejects with a
SyntaxError
.
FontFace.status
只读
"unloaded"
,
"loading"
,
"loaded"
,或
"error"
.
FontFace.stretch
CSSOMString
that retrieves or sets how the font
stretches
. It is equivalent to the
font-stretch
descriptor.
FontFace.style
CSSOMString
that retrieves or sets the
style
of the font. It is equivalent to the
font-style
descriptor.
FontFace.unicodeRange
CSSOMString
that retrieves or sets the
range of unicode codepoints
encompassing the font. It is equivalent to the
unicode-range
descriptor.
FontFace.variant
CSSOMString
that retrieves or sets the
variant
of the font. It is equivalent to the
font-variant
descriptor.
FontFace.weight
CSSOMString
包含
weight
of the font. It is equivalent to the
font-weight
descriptor.
This interface doesn't inherit any method.
FontFace.load()
Promise
that resolves with the current FontFace object.
| 规范 | 状态 | 注释 |
|---|---|---|
|
CSS Font Loading Module Level 3
The definition of 'FontFace' in that specification. |
工作草案 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
FontFace
|
Chrome 35 | Edge 79 | Firefox 41 | IE ? | Opera 22 | Safari 10 | WebView Android 37 | Chrome Android 35 | Firefox Android 41 | Opera Android 22 | Safari iOS 10 | Samsung Internet Android 4.0 |
FontFace()
构造函数
|
Chrome 35 | Edge 79 | Firefox 41 | IE ? | Opera 22 | Safari 10 | WebView Android 37 | Chrome Android 35 | Firefox Android 41 | Opera Android 22 | Safari iOS 10 | Samsung Internet Android 4.0 |
display
|
Chrome 60 | Edge 79 | Firefox 58 | IE ? | Opera 47 | Safari 11 | WebView Android 60 | Chrome Android 60 | Firefox Android No | Opera Android 44 | Safari iOS No | Samsung Internet Android 8.0 |
系列
|
Chrome 35 | Edge 79 | Firefox Yes | IE ? | Opera Yes | Safari 10 | WebView Android 37 | Chrome Android 35 | Firefox Android Yes | Opera Android Yes | Safari iOS Yes | Samsung Internet Android 4.0 |
featureSettings
|
Chrome 35 | Edge 79 | Firefox Yes | IE ? | Opera Yes | Safari 10 | WebView Android 37 | Chrome Android 35 | Firefox Android Yes | Opera Android Yes | Safari iOS Yes | Samsung Internet Android 4.0 |
load
|
Chrome
45
|
Edge 79 | Firefox Yes | IE ? | Opera Yes | Safari 10 |
WebView Android
45
|
Chrome Android
45
|
Firefox Android Yes | Opera Android Yes | Safari iOS Yes |
Samsung Internet Android
5.0
|
loaded
|
Chrome
45
|
Edge 79 | Firefox Yes | IE ? | Opera Yes | Safari 10 |
WebView Android
45
|
Chrome Android
45
|
Firefox Android Yes | Opera Android Yes | Safari iOS Yes |
Samsung Internet Android
5.0
|
status
|
Chrome 35 | Edge 79 | Firefox Yes | IE ? | Opera Yes | Safari 10 | WebView Android 37 | Chrome Android 35 | Firefox Android Yes | Opera Android Yes | Safari iOS Yes | Samsung Internet Android 4.0 |
stretch
|
Chrome 35 | Edge 79 | Firefox Yes | IE ? | Opera Yes | Safari 10 | WebView Android 37 | Chrome Android 35 | Firefox Android Yes | Opera Android Yes | Safari iOS Yes | Samsung Internet Android 4.0 |
style
|
Chrome 35 | Edge 79 | Firefox Yes | IE ? | Opera Yes | Safari 10 | WebView Android 37 | Chrome Android 35 | Firefox Android Yes | Opera Android Yes | Safari iOS Yes | Samsung Internet Android 4.0 |
unicodeRange
|
Chrome 35 | Edge 79 | Firefox Yes | IE ? | Opera Yes | Safari 10 | WebView Android 37 | Chrome Android 35 | Firefox Android Yes | Opera Android Yes | Safari iOS Yes | Samsung Internet Android 4.0 |
variant
|
Chrome 35 | Edge 79 | Firefox Yes | IE ? | Opera Yes | Safari 10 | WebView Android 37 | Chrome Android 35 | Firefox Android Yes | Opera Android Yes | Safari iOS Yes | Samsung Internet Android 4.0 |
weight
|
Chrome 35 | Edge 79 | Firefox Yes | IE ? | Opera Yes | Safari 10 | WebView Android 37 | Chrome Android 35 | Firefox Android Yes | Opera Android Yes | Safari iOS Yes | Samsung Internet Android 4.0 |
| Available in workers | Chrome 69 | Edge 79 | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android 69 | Chrome Android 69 | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android 10.0 |
完整支持
不支持
兼容性未知
实验。期望将来行为有所改变。
见实现注意事项。
FontFace