CSS 字体加载 API

这是 实验性技术
检查 浏览器兼容性表格 在生产中使用这之前。

The CSS Font Loading API provides events and interfaces for dynamically loading font resources.

接口

FontFace
Represents a single usable font face.
FontFaceSet
An interface loading font faces and checking their download statuses.
FontFaceSource
A mixin providing all of the fonts used in font-related operations, unless defined otherwise. It defines the FontFaceSources.fonts property available to Document and WorkerGlobalScope .
FontFaceSetLoadEvent
Fired whenever a FontFaceSet loads.

规范

规范 状态 Comment
CSS Font Loading Module Level 3 工作草案 初始定义。

浏览器兼容性

FontFace interface

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
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
family
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
45
不支持 35 — 45
注意事项
注意事项 Before Chrome 45, the returned promise resolved with void instead of a FontFace object as required by the specification.
Edge 79 Firefox Yes IE ? Opera Yes Safari 10 WebView Android 45
45
不支持 37 — 45
注意事项
注意事项 Before WebView 45, the returned promise resolved with void instead of a FontFace object as required by the specification.
Chrome Android 45
45
不支持 35 — 45
注意事项
注意事项 Before Chrome 45, the returned promise resolved with void instead of a FontFace object as required by the specification.
Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0
5.0
不支持 4.0 — 5.0
注意事项
注意事项 Before Samsung Internet 5.0, the returned promise resolved with void instead of a FontFace object as required by the specification.
loaded
Chrome 45
45
不支持 35 — 45
注意事项
注意事项 Before Chrome 45, the returned promise resolved with void instead of a FontFace object as required by the specification.
Edge 79 Firefox Yes IE ? Opera Yes Safari 10 WebView Android 45
45
不支持 37 — 45
注意事项
注意事项 Before WebView 45, the returned promise resolved with void instead of a FontFace object as required by the specification.
Chrome Android 45
45
不支持 35 — 45
注意事项
注意事项 Before Chrome 45, the returned promise resolved with void instead of a FontFace object as required by the specification.
Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0
5.0
不支持 4.0 — 5.0
注意事项
注意事项 Before Samsung Internet 5.0, the returned promise resolved with void instead of a FontFace object as required by the specification.
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

图例

完整支持
完整支持
不支持
不支持
兼容性未知
兼容性未知
实验。期望将来行为有所改变。
实验。期望将来行为有所改变。
见实现注意事项。
见实现注意事项。