Modern Font Stacks
modernfontstacks.com
Modern Font Stacks
1–10 of 80 posts
Re: Modern Font Stacks
#2Pretty sure I've seen it posted before, perhaps on HN itself.
Re: Modern Font Stacks
#3Re: Modern Font Stacks
#4Good resource. Pretty sure I've seen it posted before, perhaps on HN itself.
Re: Modern Font Stacks
#5Re: Modern Font Stacks
#6Re: Modern Font Stacks
#7Good resource. Pretty sure I've seen it posted before, perhaps on HN itself.
Re: Modern Font Stacks
#8Sure there is no flash with “system ui” font but that font is different on every OS?
For most documents mainly designed for reading it should not matter at all. People will do a lot of stuff to your page anyways (reader mode, zooming 10-20x, adblockers that block fonts…)
Re: Modern Font Stacks
#9For example, I always take Google Font's suggestion for Inter[1]:
font-family: "Inter", sans-serif;
and change it to: font-family: "Inter", system-ui, sans-serif;
or e.g. EB Garamond[2] from: font-family: "EB Garamond", serif;
to: font-family: 'EB Garamond', 'Iowan Old Style', 'Palatino Linotype', 'URW Palladio L', P052, serif;
It makes for less layout shift on slower connections too.Re: Modern Font Stacks
#10For 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 end up rendering 'JetBrains Mono NL' - the user-configured default monospace font.Setting `font-family: 'Cascadia Code', monospace;` would also render 'JetBrains Mono NL' - privacy features prevent pages from querying non-standard system fonts and this will also be reflected as a console warning message: 'Request for font "Cascadia Mono" blocked at visibility level 2 (requires 3)".'
Now, if you were to use he "Monospace Code" font stack listed on this page `font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;`, you will render... Yup, 'Consolas'!
1. `ui-monospace` - remains unsupported by Firefox which is lame (would also render 'Consolas').
2. `Cascadia Code` - see above, access denied because it isn't natively available on Windows 10 (also, coding ligatures... more like illigatures, amirite?).
3. `Source Code Pro` - skipped due to unavailability.
4. `Menlo` - skipped due to unavailability.
5. `Consolas` - next option in line, this one is available and is the one that will be chosen.
6. `DejaVu Sans Mono` - skipped, font already determined.
7. `monospace` - skipped, font already determined.
These modern font stacks suck. Please, if you want to render font and it has to be something specific, then use an actual web font and simply fall back to the default 'monospace' which is controlled by the user.