Right now, the webfont CSS file for my website and blog is 89734 bytes in size. This is a very fast load, with well under a fraction of second of “font change flash” even on a 4g network in a third world country. Point being, I don’t see the point of having a large font stack in the day and age of webfonts. To get a reasonable looking “flash of content”, I used https://screenspan.net/fallback which determined that Ve…
Modern Font Stacks
21–30 of 80 posts
Re: Modern Font Stacks
#22An example of something to keep in mind with this technique is that you might actually end up causing the browser to render a different font than either you or the user intended. For a practical example: Environment - Latest Firefox on Windows 10. - Manually installed fonts 'Cascadia Code' and 'JetBrains Mono NL'. - Firefox default 'monospace' font set to 'JetBrains Mono NL'. Setting `font-family: monospace;` would e…
Your example is instructive, but I fail to see what the problem is. This is working as intended, no?
Windows 11+ -> Cascadia Code Windows 7+ -> Consolas
Re: Modern Font Stacks
#23An example of something to keep in mind with this technique is that you might actually end up causing the browser to render a different font than either you or the user intended. For a practical example: Environment - Latest Firefox on Windows 10. - Manually installed fonts 'Cascadia Code' and 'JetBrains Mono NL'. - Firefox default 'monospace' font set to 'JetBrains Mono NL'. Setting `font-family: monospace;` would e…
I don't think web pages should stay away from font stacks just to handle people with changed esoteric browser prefs. If you as a user want to see different fonts everywhere, you'll need invasive tools that block font face etc. Or Firefox (where this message comes from) has a setting to "Allow pages to choose their own fonts, instead of your selections above"
That hurts. I see where you are standing, and can confirm you expressed opinion of the contemporary majority of browser users, but man, how sad it that. The attitude diverged by a light years, when "Setting preferred fonts for generic font families" is now "esoteric". (Web) browsers ("user agents") came to existence with these capabilities in mind, and even now are build around the principle of "preferences reconciliation" between defaults, author and user (as opposed to simple "display what author dictates"). And default font choice is probably the very first aspect it ever had to handle.
(Or were you referring to some other "pref"?)
Re: Modern Font Stacks
#24An example of something to keep in mind with this technique is that you might actually end up causing the browser to render a different font than either you or the user intended. For a practical example: Environment - Latest Firefox on Windows 10. - Manually installed fonts 'Cascadia Code' and 'JetBrains Mono NL'. - Firefox default 'monospace' font set to 'JetBrains Mono NL'. Setting `font-family: monospace;` would e…
Your example is instructive, but I fail to see what the problem is. This is working as intended, no?
Re: Modern Font Stacks
#25Sure there is no flash with “system ui” font but that font is different on every OS?
In a lot of cases, branding matters, and having consistent cross-platform rendering matters.
However, I’ve had good experiences using system-ui with in-house dashboard-y apps. I’m the principle UI designer at my startup, and I recommend this font stack for anyone coding up internal-use-only observability tooling and monitoring stuff. We’re all on Chrome, we’re all on Macs, and getting SF Pro on the page without having to call a CDN or manage font assets is a win.
Re: Modern Font Stacks
#26An example of something to keep in mind with this technique is that you might actually end up causing the browser to render a different font than either you or the user intended. For a practical example: Environment - Latest Firefox on Windows 10. - Manually installed fonts 'Cascadia Code' and 'JetBrains Mono NL'. - Firefox default 'monospace' font set to 'JetBrains Mono NL'. Setting `font-family: monospace;` would e…
"privacy features prevent pages from querying non-standard system fonts"
Do you know if and where it is documented which fonts various browsers consider "standard" on which platform? I am afraid I know the answer but one can hope.
Re: Modern Font Stacks
#27Earlier quoted context omitted.
I don't think web pages should stay away from font stacks just to handle people with changed esoteric browser prefs. If you as a user want to see different fonts everywhere, you'll need invasive tools that block font face etc. Or Firefox (where this message comes from) has a setting to "Allow pages to choose their own fonts, instead of your selections above"
These font stacks don't handle anything at all, they just throw a bunch of common typeface names at the wall and they can't even tell what sticks because it's so random. All the while, the user might have a prefered fallback font set that they prefer over any of the ones in the font stack - and even if that isn't the case, simply using 'monospace' as the only fallback will render the default monospace font anyway. I…
Anytime someone on HN doesn't understand CSS, they throw up their hands and call it random. Just because you don't understand what's happening doesn't mean it's random.
I don't understand the SAM76 programming language, but I don't pretend that
!%ii,*,1,1,!%mu,*,%F,%su,*,1//////////=
is "random."the user might have a prefered fallback font set that they prefer over any of the ones in the font stack
Great! Then the user gets his preferred font, as requested, instead of the one the page specified. Sounds like a win, so I'm not sure what you're complaining about. I expect you'd also complain if the web page overrode the user's choice.
I disagree with the notion that common browser configuration options available for users to change through the main/general browser settings UI would in any way be esoteric.
Of the six billion or so people on the web, the number of people manually overriding fonts isn't even a rounding error. It's not even a rounding error's rounding error. Get out of the tech bubble.
Re: Modern Font Stacks
#28Earlier quoted context omitted.
Your example is instructive, but I fail to see what the problem is. This is working as intended, no?
It already works as intended. If the intent is to render a default system font, then let the system handle that by simply applying 'monospace'.
Re: Modern Font Stacks
#29Right now, the webfont CSS file for my website and blog is 89734 bytes in size. This is a very fast load, with well under a fraction of second of “font change flash” even on a 4g network in a third world country. Point being, I don’t see the point of having a large font stack in the day and age of webfonts. To get a reasonable looking “flash of content”, I used https://screenspan.net/fallback which determined that Ve…
I think at least a small version of a font stack like these isn't a bad idea even if you're using web fonts. Folks who insist on disabling web fonts are likely a small percentage of any given site's readers, but they're out there. (And for certain sites, like this very one, there's a much higher percentage of them, usually ready to hop right out and proclaim how arrogant it is for web developers to choose typefaces f…
font-family: "Roboto Serif", Verdana, sans-serif;
(Because of the OFL, “Roboto Serif” is replaced by another name since I modified the font when I subsetted it)Large font stacks made sense in the days of IE6 for the following reasons:
• Dial up users did not have enough bandwidth to download webfonts.
• Only IE supported webfonts, in a weird proprietary “eot” format
• 99% of desktop operating systems all had the same web safe fonts “Verdana/Georgia/Trebuchet/Times New Roman/Arial/etc.”
Here in 2025, font stacks no longer make as much sense:
• 100k for a webfont package is a small file, even on a 4g network in a third world country. [1]
• All mainstream current browsers support woff2 webfonts [3][4]
• On Android, font support is very limited and has no support for the old school “web safe” core fonts for the web (Verdana/etc.)
As an aside, if metric compatibility (i.e. all of the fonts letters are the same size) with an OS core font is needed, “Arimo”/“Liberation Sans” is metrically compatible with Arial, “Liberation Serif”/“Tinos” is metrically compatible with Times New Roman, and “Cousine”/“Liberation Mono” is metrically compatible with Courier New.
[1] CJK users have font files large enough where the download size might be an issue. In that case, we either accept the download size as part of a modern website, or we accept that Android users will get Noto [2] while Mac/Windows users will get different looking system fonts.
[2] These font stacks linked in this article by and large all end up using Noto on Android phones. [5] I personally await the day when Apple and Microsoft include Noto by default with their OSes, so “font-family: Noto, sans-serif;” always does the right thing.
[3] 96% over at https://caniuse.com/?search=woff2
[4] Some people will turn off webfonts, but those people have made it clear they don’t care whether or not they get a font which looks like the design the webmaster intended. Again, use https://screenspan.net/fallback to find a reasonably metrically compatible fallback font.
[5] Looking at them in Firefox on my Android phone, “System UI” works, “Neo-Grotesque” gives a pencil thin font which is very difficult to read (“Inter” on my phone is pencil thin), “Slab Serif” actually looks nice (both in Windows, with Rockwell, and on Android, with Roboto Slab), and “Handwritten” works for its purpose (Android uses a “Cursive” fallback font). All the other font stacks are giving me the system default serif/sans/mono fonts (either Noto or Roboto). With Chrome on my Android phone, source sans pro is used a lot, as well as Google specific metric compatible versions of “Arial”, “Georgia”, “Courier New”; “Slab Serif” doesn’t work there even though Roboto Slab is installed on my Android system. Point being, Android has made web safe fonts a thing of the past.
Re: Modern Font Stacks
#30An example of something to keep in mind with this technique is that you might actually end up causing the browser to render a different font than either you or the user intended. For a practical example: Environment - Latest Firefox on Windows 10. - Manually installed fonts 'Cascadia Code' and 'JetBrains Mono NL'. - Firefox default 'monospace' font set to 'JetBrains Mono NL'. Setting `font-family: monospace;` would e…