W3C home > Mailing lists > Public > www-style@w3.org > May 2012

Re: [css3-fonts][cssom] Load events for webfonts?

From: Sebastian Zartner <sebastianzartner@gmx.de>
Date: Fri, 25 May 2012 05:54:03 +0200
Cc: www-style@w3.org
Message-ID: <20120525035403.182990@gmx.net>
To: John Daggett <jdaggett@mozilla.com>, jackalmage@gmail.com
> > It looks to me (though I read it somewhat quickly) like consensus
> > there was tending towards:
> >  * events when fonts load
> >  * an API to ask whether all the fonts for an element/document have
> >    been loaded
> The tricky part of this is that @font-face fonts load on demand and
> which font in a family is loaded is determined by the style matching
> rules.  So if the author defines four @font-face rules for regular,
> bold, italic and bold italic but only the italic face is needed,
> that's the only one that will be loaded (modulo EOT font load behavior
> in pre-IE9 versions of IE which is not lazy).
> I think the two API's above may be the simplest to implement.  I think
> the "all fonts loaded?" API should be associated with the document,
> since fonts are attached to the document not to specific elements.

Just to give another example where such events / API would be needed:

Firebug wants to highlight the used font(s) inside an element. For web fonts it fails because it displays the styles before the fonts are loaded:


Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
Received on Friday, 25 May 2012 03:54:34 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:59 UTC