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

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 UTC