3 ms·
> Why does the web browser need to make available the list of all fonts on a user's machine? In many cases I think the question is more "what functionality wou
by mrec 6y ago
> Why does the web browser need to make available the list of all fonts on a user's machine?
In many cases I think the question is more "what functionality would the web browser need to break to prevent pages detecting X, and is that worth it?".
I remember doing this kind of detection years ago for an (entirely benign) chart authoring webapp; you don't want to offer a font for client-side rendering if the client doesn't have it. You can generally assume that the `monospace` and `serif` fallbacks are different, so if you have one layout box with text in `font-family:FontToDetect,monospace` and another with the same text but `font-family:FontToDetect,serif` and they both come out the same width, it's good odds that the user has that font. [EDIT: originally got that backwards due to brainfart]
Nowadays the existence of `@font-face` makes that particular problem mostly obsolete, but the same general principle applies all over.