W3C home > Mailing lists > Public > www-style@w3.org > September 2010

RE: Shouldn't fonts embedded through @font-face be available in <canvas>?

From: Sergey Malkin <sergeym@microsoft.com>
Date: Sun, 26 Sep 2010 16:45:08 +0000
To: "list.adam@twardoch.com" <list.adam@twardoch.com>
CC: www-font <www-font@w3.org>, www-style <www-style@w3.org>
Message-ID: <F759D7752D3BBC4999CA69FF4FB8BC130264E920@TK5EX14MBXW652.wingroup.windeploy.ntdev.microsoft.com>
Good point about font loading. Although IE works fine without div, but in this case page was loading from local disk and font had been loaded immediately. I'll  have to try it loaded from server tomorrow.

Thanks,
Sergey

-----Original Message-----
From: Adam Twardoch (List) [mailto:list.adam@twardoch.com] 
Sent: Sunday, September 26, 2010 9:17 AM
To: Sergey Malkin
Cc: www-font; www-style
Subject: Re: Shouldn't fonts embedded through @font-face be available in <canvas>?

 On 10-09-26 18:05, Sergey Malkin wrote:
> One implementation is missing from your "none" list ;). Try attached in IE9 Beta or PPB5 (replace font url with your favorite). 
Aah, nice! :)

BTW, I just realized that I was wrong last night. @font-face is supported, it's just a bit tricky because the JavaScript methods that do the canvas drawing must be executed only after the embedded font has been completely loaded. This forces the web author to resort to certain tricks (put a hidden div that uses the font so the browsers loads it, then load it again using JavaScript).

So, not very reliable, yet it does work. Tested in Firefox 4, Safari, Chrome and Opera -- and I assume IE9 also supports it. Splendid!

Best,
Adam



Received on Sunday, 26 September 2010 16:47:15 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:31 GMT