Hacker News new | ask | show | jobs
by hLineVsLineH 1194 days ago
The say, "then you don't care about typography at all." You say, "If [...] it's not so important [...]" To me, it sounds like you two are in agreement. If it's not important, i.e. if you don't care about it, then it's fine.

> If I want to display a document with some atmosphere for which several fonts could be suitable

There's no such thing as "several fonts could be suitable". All the fonts in these stacks have different metrics, so you can't even set appropriate values for something as basic as the font size and line spacing.

If you design your page using Gill Sans Nova, for example, and someone views it with DejaVu Sans — congratulations, the text now looks something like 50% bigger than you intend it to be. And if you set a sensible size for DejaVu Sans, someone will get unreadable text with some other font. This is not "very good". It's bad.

It might be okay to use these font stacks as fallback when the custom font doesn't work, but it's not "the better solution" if you care about typography.

> I care more about performance and resource usage

It's a valid concern but fonts aren't really that big. Some people are shipping favicons that are like 40kB. That's enough to fit a font.

> The default generic font will probably be a well designed font that the user is used to

System fonts aren't necessarily well designed. And I'm not sure why "the user is used to it" is a good thing. It seems to be the opposite. People complain when a font is familiar to the point that it feels tired and overused.

> Since fonts are mostly a matter of taste anyway, it's not clear the user will prefer this custom font

The user is always in control. They can always choose what to load and what styles to apply. That doesn't mean people should stop designing webpages that looks good.

2 comments

> If it's not important, i.e. if you don't care about it.

No. I care about typography. You left out the critical part of this sentence: "it's not important if the default font is used".

Now I understand that you also say that default fonts are not necessarily well designed. On my side, these default fonts have looked good on every device I have used, and I'm more often annoyed by arbitrary font settings that look good to the designer who happened to design the web page I'm reading.

> The user is always in control. They can always choose what to load and what styles to apply

In practice, I'm not going to design each page I visit. I'm blocking web fonts by default, but that sometimes triggers a bad setting where the font that is used as a fallback looks very bad. I guess that happens when people assume that the web font will be loaded and don't default to (sans-)serif in their font-familly CSS property.

> "it's not important if the default font is used".

That's also what they said. They said "You may as well just do 'serif' or 'sans-serif' and be done with it."

> Now I understand that you also say that default fonts are not necessarily well designed.

While fonts are a matter of taste, objectively speaking fonts that comes preinstalled on systems often have very few weights and support only a very limited range of glyphs. They also lack features such as small caps, old-style numbers, etc.

Usually, though, the main, default sans-serif and/or UI font on the system are much better than some random font that just happens to be included in the system. So you will usually be better off using `sans-serif` than any of these font stacks.

> I guess that happens when people assume that the web font will be loaded and don't default to (sans-)serif in their font-familly CSS property.

But this is just yet another reason why using font stacks is bad...? If instead you just use `serif` or `sans-serif` it will follow the user's font preference.

> congratulations, the text now looks something like 50% bigger than you intend it to be

Some of these "stacks" do make poor choices with respect to matching the overall metrics of the fonts, but there are any number of reasons why a font might display bigger or smaller than you "intend it to be" in a web browser. Web design fundamentally has to account for this.

Yes, and that's exactly the problem with this approach. There's no accounting for the different metrics of the fonts.

Font size and font family should ideally always be set together. If you're setting a font-size, then you should force a font-family, and vice versa. Otherwise, you should set neither and let the user agent decide. This ensures that you would never get a broken combination that's uncomfortable or unusable.

It's similar to the idea that whenever you're setting a foreground color, you should always set the background color as well.