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

Re: [whatwg] Canvas: Fonts in workers

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 21 Feb 2013 05:59:41 +0000 (UTC)
To: Jonas Sicking <jonas@sicking.cc>
Message-ID: <Pine.LNX.4.64.1302210558350.3956@ps20323.dreamhostps.com>
Cc: WHATWG <whatwg@lists.whatwg.org>, John Daggett <jdaggett@mozilla.com>
On Wed, 20 Feb 2013, Jonas Sicking wrote:
> 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.

My expectation was that this is how FontLoader would work for workers. (We 
can't rely on what fonts are in the Document since that's shared state, 
and workers try to avoid shared state as a design principle.)

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 21 February 2013 06:00:10 UTC

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