Description
Rework of the font system
Summery
There are numerous problems with the typography on the site. Imo, we should zoom a little bit out and rethink it in context rather than working on them separately. My goal with this issue is to summarise the problems, give a little bit of context and propose a direction forward.
Ideally this could lead to a high level discussion and explicit reasoning for the design choices. This could come in handy to have something to reference in case of drive-by change requests.
In Detail
The current font setup is Alfa Slab One for headlines and Fira Sans (in 6 variants) for body text. Current issues are:
- Alfa Sans One is missing characters for the turkish translation (issue Fix Alfa Sans One #858)
- Fira Sans is also missing characters, but this could be fixed with using the extended Fira Go typeface (issue Replace Fira with FiraGO #755). Potential problem is the increased font size.
- The rust in productions section could use some typographic love (issue Rework "Rust in Production" section #772)
To add some of my own
- the code blocks use
font-family: Consolas,monaco,monospace
. Both Consolas and Monaco are very different from fira sans, and on many linux boxes it will render as whatever is the standard monospace font, probably something courier-ish. - For my eyes, the site is very busy. I really like the friendly, colourful and slightly whimsical concept and i'm not arguing changing that, but imo it could benefit from a calmer typography to balance it a little bit out.
- Also on the issue of color, some combinations of text color and background are problematic in terms of contrast. Again not arguing a change here, but we could some other measures to boost readability.
design review
I was not involved in the original design of the site, so i don't know the exact reasons for the particular choices. But i want to argue that the current state is a sound basis.
The headline font Alpha Slab One is a take on the classic egyptian slab serif font and mirrors the style of the rust logo. I really like that connection and its delightfully whimsical and bold.
The text font was probably inherited from the old site and is also used in rustdocs and other rust materials. Fira Sans is very closely related to the meta typeface which was created in the 80s, at first intended for a rebranding of the german postal service. Meta Sans is probably the most successful humanistic sans serif typeface overall. A lot of cooperations adopted it (or variants) to project an approachable image. It's kind of an antithesis to helvitica.
One of those cooperations is Mozilla, which explains their commission of a free variant for the now defunct Firefox OS.
Imo, the style of the typeface is very fitting for the rust project and the approachable, friendly image we want to project. Its a bit overused, but still a great design and extremely readable (plenty of space between the letters, open counters, the hooked "l", the serif on the i etc.).
What should we do to address the problems?
My proposal: We don't change the fonts choices itself. If we could use non-free fonts i would have some recommendations for great, but less overused humanistic sans serifs, but if we want to stay free this is as good as its gets.
But:
- We tighten up the usage. Get the line heights and font sizes more unified
- We use Fira Go to get i18n support. We probably have to review what we really need, since every variant is around 300kb big
- We get down to one base font plus a single variant. Currently we use three weights in both italic and bold. My proposal is to use a single weight consistency and use italics for emphasis and quotes. This should calm down the appearance of the text quite a bit and makes it feasible to use Fira Go. Also, the italic variant in fira is just really nice and i'd like to test the usage for subheads (that are currently bold).
- We use Fira Mono for the code examples
- We bump the text size up to 20px, at least on large screens
- We extend Alpha Slab One. It's license allows that and i have the tools and knowledge to do that, but we have to review how much is missing. I wouldn't propose that for a text font or a whole family, but with a single weight display font it should be doable
Alternatives
One possibility is to just use the system font instead of Fira (proposed and closed in issue ##506). In principal, i like that approach and it should be used for often in general. No loading time, people are already used to the font and we can be sure that i188n is no problem.
But: The site would lose a lot of character since its more or less only typography and color. In addition to that there is no user generated content, so we know what characters we need in our font.
An alternative to the extension of Alpha Slab One would be finding an alternative with similar design, but extended glyph set. I haven't looked around yet.