[whatwg] Canvas: Fonts in workers
jonas at sicking.cc
Wed Feb 20 21:47:43 PST 2013
On Wed, Feb 20, 2013 at 2:55 AM, Anne van Kesteren <annevk at 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
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.
More information about the whatwg