Henri Sivonen 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.
These are precisely the problems that the loadFonts method of the FontLoader object are meant to address: http://dev.w3.org/csswg/css3-fonts/#fontloader-loadfont As Jonathan mentioned, the exact details of this API are still under discussion but I think the basic set of features is there. John _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform