This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The 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.displayCSSOMString that determines how a font face is displayed based on whether and when it is downloaded and ready to use.FontFace.familyCSSOMString that contains the family of the font. It is equivalent to the font-family descriptor.FontFace.styleCSSOMString that contains the style of the font. It is equivalent to the font-style descriptor.FontFace.weightCSSOMString that contains the weight of the font. It is equivalent to the font-weight descriptor.FontFace.stretchCSSOMString that contains how the font stretches. It is equivalent to the font-stretch descriptor.FontFace.unicodeRangeCSSOMString that contains the range of code encompassed the font. It is equivalent to the unicode-range descriptor.FontFace.variantCSSOMString that contains the variant of the font. It is equivalent to the font-variant descriptor.FontFace.featureSettingsCSSOMString that contains the features of the font. It is equivalent to the font-feature-settingsdescriptor.FontFace.status Read only
"unloaded", "loading", "loaded", or "error".FontFace.loaded Read only
Promise to a FontFace that fulfills when the font is completely loaded and rejects when an error happens.This interface doesn't inherit any method.
FontFace.load()Promise to a FontFace that fulfills when the font is completely loaded and rejects when an error happens.| Specification | Status | Comment |
|---|---|---|
| CSS Font Loading Module Level 3 The definition of 'FontFaceSet' in that specification. | Working Draft | Initial definition |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | 35 | ? | 41 | ? | ? | ? |
FontFace() constructor
|
35 | ? | 41 | ? | ? | ? |
display
|
60 | ? | No | ? | 47 | No |
family
|
Yes | ? | ? | ? | Yes | ? |
style
|
? | ? | ? | ? | ? | ? |
weight
|
? | ? | ? | ? | ? | ? |
stretch
|
? | ? | ? | ? | ? | ? |
unicodeRange
|
? | ? | ? | ? | ? | ? |
variant
|
? | ? | ? | ? | ? | ? |
featureSettings
|
? | ? | ? | ? | ? | ? |
status
|
? | ? | ? | ? | ? | ? |
loaded
|
? | ? | ? | ? | ? | ? |
load
|
? | ? | ? | ? | ? | ? |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | 37 | 35 | ? | 41 | ? | ? | ? |
FontFace() constructor
|
37 | 35 | ? | 41 | ? | ? | ? |
display
|
60 | 60 | ? | No | 47 | No | ? |
family
|
Yes | Yes | ? | ? | Yes | ? | ? |
style
|
? | ? | ? | ? | ? | ? | ? |
weight
|
? | ? | ? | ? | ? | ? | ? |
stretch
|
? | ? | ? | ? | ? | ? | ? |
unicodeRange
|
? | ? | ? | ? | ? | ? | ? |
variant
|
? | ? | ? | ? | ? | ? | ? |
featureSettings
|
? | ? | ? | ? | ? | ? | ? |
status
|
? | ? | ? | ? | ? | ? | ? |
loaded
|
? | ? | ? | ? | ? | ? | ? |
load
|
? | ? | ? | ? | ? | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/FontFace