W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2013

Re: [whatwg] Canvas: Fonts in workers

From: Jonas Sicking <jonas@sicking.cc>
Date: Wed, 20 Feb 2013 21:47:43 -0800
Message-ID: <CA+c2ei9hd6htE6-3=-nmtqf8MGSJUD+hiewQA+OawQVp+LYEmg@mail.gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: WHATWG <whatwg@lists.whatwg.org>, John Daggett <jdaggett@mozilla.com>
On Wed, Feb 20, 2013 at 2:55 AM, Anne van Kesteren <annevk@annevk.nl> wrote:
> I think currently the specification assumes FontLoader is the solution
> to fonts in workers. However, 1) FontLoader as currently designed does
> not work in workers. 2) Even if slightly modified it would not work in
> shared workers as FontLoader is pretty much tied to the document that
> has the relevant @font-face declarations. I don't really have a good
> solution to this problem.

In general, we need to define which fonts are available to use when
drawing text into a canvas in a worker. For a dedicated worker we
could say that it's the same set as is available in the document,
except that that set can change at any time as new fonts are loaded.
And for a shared worker this is even more complicated since multiple
documents, with different sets of fonts, can be connected to the same
shared worker.

We could possibly still use the the FontLoader interface if we do the following:
* FontLoader needs to drop the dependency on CSSFontFaceRule (or at
least make the dependency optional and not available in workers).
* We'll expose a global FontLoader object per worker scope.
* The worker can't use any downloaded fonts other than the ones loaded
through the global FontLoader for that scope.

/ Jonas
Received on Thursday, 21 February 2013 05:48:37 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:19 UTC