Re: [css-font-loading] how/when do FontFace objects end up in a FontFaceSet

On Fri, Feb 28, 2014 at 12:20 AM, John Daggett <jdaggett@mozilla.com> wrote:
> Sort of along the line of Jonas's question, it's unclear to me precisely how/when
> newly created FontFace objects are added to the appropriate
> FontFaceSet (e.g. document.fonts).  Is the intent that they are
> automatically added at construction? If so, then the spec needs to
> state that clearly. If not, then it should state that an explicit add
> is required.

Construction doesn't mention anything about automatically adding it to
the document's font source, so it doesn't do so.

I can add a note if you think it would be useful as a reminder.

> The spec *really* needs references to the Promises API.  How about a
> normative reference to Dominec's spec [1] and an informative reference
> to the HTML5Rocks article on Promises [2] for now?  Something is
> better than nothing. I realize the spec is still in flux within the
> ES6 group.

I was waiting for things to settle down, but I can go ahead and add
those links for now.

> It seems odd that FontFace.load() has a return type of void but
> FontFaceSet.load returns a Promise. Wouldn't it be more consistent to
> have them both return a promise?

Yeah, other people have cited this as something weird.  It's a
path-dependent thing; I originally didn't have the "status" attribute,
so .ready() was the only way to observe the load status.

I've removed .ready() from FontFace and just made .load() return the
[FontStatusPromise].

~TJ

Received on Tuesday, 4 March 2014 23:46:05 UTC