3 ms·
Browsers are in a tough spot: when you specify a font, there's no way to programmatically determine how critical that font is to your design (see the FOUT discu
by acdha 13y ago
Browsers are in a tough spot: when you specify a font, there's no way to programmatically determine how critical that font is to your design (see the FOUT discussion saurik linked above).
There are two things which we need to fix this:
1. Simple, robust font load events so you could treat this like any other type of content and make the decision about whether to display an alternative until something finishes loading:
http://dev.w3.org/csswg/css-font-load-events/ http://dev.w3.org/csswg/css-font-load-events/
2. As a lower priority, browser support for using the @font-face unicode-range property to avoid unnecessary downloads. It's not uncommon for sites to use a webfont with known support for non-ASCII characters to avoid issues with older operating systems & browsers. Unfortunately, there's a huge problem with this because specifying a webfont will cause it to be downloaded at least as soon as an element on the page uses that font[1] and it'd be really nice if there was a way to e.g. list a font which should only be downloaded if one of the earlier fonts in the stack doesn't contain the needed glyph so I could say "font-family: Arial, noto-sans" and have a Windows 7 user not download anything while still displaying correctly, if slower, for an XP user.
1. Test cases & bug reports here: http://chris.improbable.org/experiments/browser/webfonts/universal-noto-sans/ http://chris.improbable.org/experiments/browser/webfonts/uni...
- tracker1 13y agoJust want to point out one minor nit to pick.. NEVER specify "Arial" or "Helvetica" as fonts and simply fall back to `sans-serif` On OSX you'll get Helvetica, on Windows you'll get Arial, which display better on their given platforms.. a Helvetica-like font is the default on pretty much every given platform for web browsers. I would say, that if a fallback font is specified in the font-face rule, then that should be used while the web-font is downloaded. Also, it would be nice, as you say, if a fallback would be used when a glyph isn't in the specified font (only for that glyph).
- acdha 13y agoYou're generally right about `sans-serif` vs. Arial/Helvetica. There used to be a complication in that even on OS X, Arial has significantly more glyphs than Helvetica but as browsers get better font substitution support and stop breaking ligatures (http://chris.improbable.org/experiments/browser/combining-half-marks/ http://chris.improbable.org/experiments/browser/combining-ha...) this matters less. It would, of course, also be significantly less important if they optimized the download decision so you could use something like noto for everything and not have to worry about significant visual differences.