Cargo Doc serif font usage

Am I the only one who's extremely surprised and slightly annoyed by the fact that the docs Cargo outputs use a serif font for the main body? Considering the code blocks have a darker backdrop I'd say differentiation is not sufficient justification. The rustbook also opted for sans serif for code blocks and body.

If I'm not the only one, what is a respectful way to bring this up on Github?

You could propose a pull request expanding the theming feature (on the right of the search bar) to allow font choices. And don't present yourself as being annoyed, just propose the improvement.

Or you could write your own user style with something like stylus.


Isn't serif the better choice when reading potentially multi-line prose? Serifs are meant to guide the eye and ease reading when longer, continuous text (like detailed explanation of an API) is present.


General consensus as I understand it is that serif fonts are typically preferable for print and sans serif for screens. More specific usage practice overrules the general advice, but it holds for body text at the usual point size.

(The print/screen split is based on reflective versus emissive, so an e-ink screen would count as print and prefer serif fonts, which I find interesting.)

What individual people prefer will be based more on what they're used to than what is conventionally considered "better," though.

1 Like

If I can add to that. I believe the biggest factor to ease reading and reduce eye strain is not the typeface or having serifs, it's font size. I believe it is the only proven factor that actually helps reading speed and comprehension.

Accordingly the ergonomic improvement I make for myself is having very big font size everywhere. 16px in vscode. This site is zoomed 150%, GitHub 130%.

I have perfect eyesight, thanks to a very successful LASIK surgery years ago, but I'm still subject to bad optical headaches when I focus too much. Zooming helps me a ton.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.