Re: [Font Loading] FontFaceSet's Ready Promise

Hi Myles,

Myles C. Maxfield:
> FontFaceSet exposes a "ready" promise attribute, which can therefore
> only be resolved once. However, fonts may start and end loading at
> any time. Therefore, this promise will give unintuitive and incorrect
> information much of the time. Instead, the mechanism used to notify
> script when all fonts in the set have finished loading should be
> achieved via sending events.

That particular Promise object will, but a new Promise object is created
and exposed through FontFaceSet.ready when a loading starts again (after
a period of loading being complete).

At any point, if you write


you’ll be guaranteed to have your callback invoked either immediately,
if there are no loads happening currently, or when the current loads
complete.  Storing away the document.fonts.ready Promise to call then()
on at a later point wouldn’t be useful.

Cameron McCormack ≝

Received on Saturday, 6 February 2016 04:45:56 UTC