4 ms·
Because "an image" is not the webfont you're actually interested in maybe?
by PavlovsCat 14y ago
Because "an image" is not the webfont you're actually interested in maybe?
- chongli 14y agoYou're not using an actual image, just an image object. Set the src attribute of the image object to the URL of the webfont and the browser will call the onerror callback when it finishes loading. See here: http://stackoverflow.com/a/5371426 http://stackoverflow.com/a/5371426
- Sephr 14y agoJust because a font has "loaded" does not mean it's ready to be used. This very problem makes it hard to load @font-face fonts on demand in <canvas> apps as there is a certain amount of time you must wait for the font to actually load that is not exposed or accounted for in any browser APIs. Even if you include a font in @font-face with a data: URI, you cannot immediately start using it.