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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 22 Aug 2012 08:40:33 -0700
Message-ID: <CAAWBYDBtKDpm1JAxXN5607PLNpViOswsFevv6Vu5VrAZf_By9Q@mail.gmail.com>
To: John Daggett <jdaggett@mozilla.com>
Cc: www-style list <www-style@w3.org>
On Wed, Aug 22, 2012 at 1:04 AM, John Daggett <jdaggett@mozilla.com> wrote:
> Tab Atkins wrote:
>> > I think you need to define some way to determine whether other
>> > font loads are still pending, since a given page may require
>> > multiple fonts due either to style selection or character
>> > handling.  Given the lazy loading nature of downloadable fonts,
>> > just defining a simple load event is insufficient.
>> >
>> > With a "loads pending" attribute somewhere, the typical font handling
>> > logic would be:
>> >
>> > 1. Make changes that might cause a font load
>> >
>> > 2. Check to see whether font loads are pending
>> >
>> > 3. If necessary, wait for font loads to complete
>> >
>> > 4. Do stuff that requires the fonts to be loaded
>>
>> I'm not handling this quite yet - for now, people can track whether
>> the fonts they care about have loaded or not by themselves.
>
> Which they can't do in all cases because that's determined by style
> matching and fallback.  Authors would need to understand in great
> detail how many fonts are going to be loaded to render the text on a
> given page.

This is sufficient for the use-cases I'm trying to solve first.
Simple pages that don't use many fonts are fine.  An app like Google
Docs knows exactly what fonts are to be used, and is fine.  An app
drawing text into <canvas> also knows exactly what fonts it's trying
to use.

~TJ
Received on Wednesday, 22 August 2012 15:41:31 GMT

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