On 11/12/12 12:18, Henri Sivonen wrote:
On Wed, Dec 5, 2012 at 5:37 AM, John Daggett
<moz.li...@windingwisteria.com> wrote:
Fonts are loaded when used so font loading won't start until the
contents using a particular font are laid out.

That seems like a problem for JS-driven display. A big problem in the
canvas case and at least an annoyance when a JS program drives the
input to CSS layout.

This optimization simply eliminates the extra reflow required by spinning the 
event
loop.

That makes sense. However, it’s still not nice for data: to be magic
for the JS-driven case. For JS-driven cases, I think the platform
really needs an async API that lets a JS program say “start loading
this font now” and then some callback for getting notified
asynchronously (regardless of URL scheme) when the font has been
loaded so that it is ready for use with canvas or ready for use with
CSS without a flash of unfontified content.


This sounds like what Font Load events and the FontLoader interface[1] are trying to address. I think that spec is still some way from being stable and ready to implement, though.

JK

[1] http://dev.w3.org/csswg/css3-fonts/#font-load-events

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to