Is there such a thing as a web-safe font?
50 comments
·January 16, 2025dvh
tobr
Depends heavily on what you mean with ”user preferred”. Approximately 0% of users will have made an active choice on what sans-serif typeface they prefer.
wruza
I tried to change browser defaults before, but that made some sites look strange because developer’s assumptions about defaults were merged with the design.
Today when I want to change the font, I just add a per-site StyleBot rule.
singpolyma3
Indeed you are doing it correctly
kragen
Yes, those are web-safe fonts.
efitz
The web is backwards. Designers and web site operators spend ridiculous amounts of engineering trying to control what users see, with the limitation that they have no control (other than exclusion) over what software the users chooses to view the content.
HTML went way too far IMO, trying not only to represent the structure of information, but ALSO trying to solve the layout problem.
It will never happen, but I long for a web where layout and content are disassociated. Where content is structured, requested by clients, delivered by servers, and then the client chooses the layout. Blind? Terminal only? Compute limited? No problem, use an agent that works for you.
But big content wants CONTROL. They want to control what you see, how you see it, and what the preconditions are. They also want the web to be an application platform (that they can control, of course, and not have to deal with Apple or Google or Microsoft) that is free to them and supports all their controls.
<rant/>
mpol
There is the system font that you can use:
font-family: 'system-ui', sans-serif;
System fonts and font rendering are now so good for readability, that you don't need anything else. I use it on one website where I don't care about pixel-perfect. In cases where the customer/owner wants a pixel-perfect layout, this will not work.
keybits
https://modernfontstacks.com/ is a great resource for more detail on this and useful suggestions for font stacks that have a similar style across platforms.
vFunct
There really should be a set of a few hundred fonts standardized by the w3c or whatwg that should come with every browser (and OS) install.
This would be like how early versions of PostScript came with about 30 standard fonts available to all PostScript printers.
mrweasel
I lean in the opposite direction, just remove the ability to specify the font type on webpages and let the browser use whatever is the system defaults.
__MatrixMan__
While we're at it, can we take color away too? Dark mode should be a browser feature, not a site feature. If I want green mode for work tabs and blue mode for personal ones, and red for one's my peers find dubious... That should be between me and the browser without the site author's involvement.
ndriscoll
You can actually take this away in Firefox! Go to your color settings and set the drop-down to always use your specified palette. Not sure if there's a way to do it based on container tabs. I don't really use containers. Unfortunately missing color variety reveals that many sites have garbage layouts and missing labels on things and do stuff like use div where they meant button, so things can be difficult to use at times. This site remains completely usable.
Linkd
I hope I never get to use interfaces you build..
mrweasel
What difference does it make what font a website uses? I get having a monotype, a serif and possibly a sans-serif, obviously setting the font size should be a thing, but the actual font?
I just don't see what difference it makes if a website is in Helvetica, Times New Roman or Arial. If one font is easier for me to read than another I can chance it in my browser, which makes more sense than letting some web designer, who's more focused on brand identity, pick a font for me.
There might be some cases where you really wish you could pick a specific font, but you can't really use it to convey meaning anyway, because that would not work for screen readers or people who chance the font on their system to help readability.
ndriscoll
Why would a website need a different font from the system font? I can get that there's "better" fonts (or at least worse ones) with different kerning or whatever, but surely people want a good font for everything? So the system is the right place to fix it.
Firefox lets you disable the ability for web pages to override the system font, and I did that a while back. Throw web fonts in the bad idea pile with blink and marquee.
vFunct
Unless you’re in fashion, you likely won’t.
In fashion (and a lot of other fields), the style IS the message.
phkahler
This is the right answer. I've never understood why "designers" feel the need to decide what font looks good to other people. You can specify font size and that should be enough.
wruza
This is not the right answer because people have different preferences, both physiological and aesthetic and contextual.
The right answer is for browsers to provide knobs for a user that would control relative brightness, contrast, saturation, boldness, fluffiness, comicness, sharpness, height, width, line spacing, and so on. Per browser and then per-site adjustments. A simple sidebar or a drawer.
tgv
You can still build web pages like it's 1999. Nothing is stopping you. You can add menu bars like you're imitating Word 6, for all I care. But people will stop visiting your site. The eye likes candy. That's why.
vFunct
It’s because designer know what you like better than you know yourself. They get paid to know you.
Never let the user design their own interfaces. Users have absolutely no idea what they’re doing.
graemep
because the customers have been trained to think that websites are about design. Its something the people paying for the site can understand. It leads to lots of bike shedding too.
dingnuts
designers entire profession is around figuring out what looks good to the most people, not just fonts; your comment is so ignorant and dismissive of an entire profession that it's startling.
you are hereby cursed to use papyrus to code and you will be forced to drive an AMC Gremlin until you appreciate the value of visual design
kijin
In a perfect world, that would be glorious.
In the real world, designers will just plaster all webpages with images to replicate the fonts they aren't allowed to use. SVG sprites, anyone? :(
__MatrixMan__
Perhaps soon we'll just render the page in a headless VM and have an AI extract the important parts, styled according to to user's wishes--a sort of condom for the web--svg-text being the least evil of the things we're filtering.
fleabitdev
It's a nice thought, but internationalisation would make that difficult. On my system, the Noto international font weighs about 170 MiB compressed (gzip-compressed TTF, sans and serif styles, all weights, including symbols and colour emoji).
Even just focusing on Latin scripts, a few hundred fonts would roughly double the compressed download size for browsers and Electron apps.
It might be possible to come up with a better compression scheme which exploits redundancy between different typefaces, but as far as I know, that tech doesn't exist yet.
kibwen
Here in the grim darkness of the future, every install of a general-purpose OS better be shipping with at least one font (or collection of fonts that operate via glyph fallback) to cover every Unicode codepoint for every language that isn't extinct yet. (In other words, apps that expect to be used with any arbitrary language, including browsers, should not be forced to ship with a font just to ensure basic coverage).
And then, once you have that system-provided codepoint coverage, you can make your font parametric in order to avoid needing to ship multiple copies of the font for different styles. It's not a perfect solution, but it's still pretty acceptable given the constraints.
fleabitdev
To provide fonts for N different scripts would multiply the file size by roughly N, and there are a lot of scripts in common use:
https://en.wikipedia.org/wiki/List_of_writing_systems#/media...
Variable fonts would help, but I don't think it would be enough, especially if the goal is to provide a wide selection of fonts.
KronisLV
> There really should be a set of a few hundred fonts standardized by the w3c or whatwg that should come with every browser (and OS) install.
It's surprising that this is never the actual discussion we have, but it's always a discussion of web safe fonts vs custom fonts.
Then again, while browsers and OSes are already pretty big size wise, fonts wouldn't exactly make that better. On the other hand, they already include a whole bunch of fonts, so having some authority delegate what should be available everywhere wouldn't be inconceivable.
throw0101c
> There really should be a set of a few hundred fonts standardized by the w3c or whatwg that should come with every browser (and OS) install.
One attempt by Microsoft:
ss64
The whole point of a font stack is to give a prioritised selection between beautiful modern fonts that won't be available on every machine and basic standard defaults like 'sans-serif' that will.
JodieBenitez
serif, sans-serif, monospace
There, you have it, and it's perfect.
anshumankmr
Yes. It's comic sans :)
kome
I think the W3C or somebody else should make Arial and Times New Roman standard and open source.
trinix912
Doesn't Microsoft hold all rights to Arial because they didn't want to license Helvetica? I don't think W3C has much say in that.
albert_e
We could make say Helvetica Libre and Times Free Roman
amarshall
They already exist, but of course aren’t exactly the same https://en.wikipedia.org/wiki/GNU_FreeFont
I've been writing "font-family: sans-serif" when I wanted user preferred font without serifs and "monospace" for user preferred monospace font. Is that not the correct way?