FontFace.load

The load() method of the FontFace interface loads a font based on current object's constructor-passed requirements, including a location or source buffer, and returns a Promise that resolves with the current FontFace object.

Syntax

let promise = FontFace.load();

Parameters

None.

Return value

A Promise that resolves with a reference to the current FontFace object when the font loads or rejects with a NetworkError DOMException if the loading process fails.

Exceptions

NetworkError

Indicates that the attempt to load the font failed.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
load
45
35-45
Before Chrome 45, the returned promise resolved with void instead of a FontFace object as required by the specification.
79
41
No
Yes
10
45
37-45
Before WebView 45, the returned promise resolved with void instead of a FontFace object as required by the specification.
45
35-45
Before Chrome 45, the returned promise resolved with void instead of a FontFace object as required by the specification.
41
Yes
10
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.

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/FontFace/load